1313jobs :
1414 build-docker-image :
1515 if : github.repository_owner == 'LCAS'
16- runs-on : lcas
16+ runs-on :
17+ - lcas
18+ - qemu
1719 strategy :
1820 fail-fast : false
1921 matrix :
2022 include :
21- - base_image : lcas.lincoln.ac.uk/lcas/limo_platform_amd64 :1
23+ - base_image : lcas.lincoln.ac.uk/lcas/limo_platform :1
2224 push_image : lcas.lincoln.ac.uk/devcontainer/ros2-teaching
2325
2426 steps :
2527 - name : Node Js
2628 uses : actions/setup-node@v4
27- with :
28- node-version : " ^16.13.0 || >=18.0.0"
29-
30- - uses : actions/checkout@v3
31- with :
32- fetch-depth : 1
33- submodules : ' recursive'
34-
35- - name : What
36- run : echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV
37-
38- - name : Docker Login LCAS
39- uses : docker/login-action@v3
40- with :
41- registry : lcas.lincoln.ac.uk
42- username : ${{ secrets.LCAS_REGISTRY_PUSHER }}
43- password : ${{ secrets.LCAS_REGISTRY_TOKEN }}
44-
45- - name : Docker meta
46- id : meta_public
47- uses : docker/metadata-action@v5
48- with :
49- # list of Docker images to use as base name for tags
50- images : |
51- ${{ matrix.push_image }}
52- ${{ matrix.push_image }}-amd64
53- # generate Docker tags based on the following events/attributes
54- tags : |
55- type=raw,value=staging
56- type=raw,enable=${{ github.event_name != 'pull_request' }},value=latest
57- type=ref,enable=${{ github.event_name != 'pull_request' }},event=branch
58- type=semver,pattern={{version}}
59- type=semver,pattern={{major}}.{{minor}}
60- type=semver,pattern={{major}}
61-
62- - name : Build Public Docker Image
63- uses : docker/build-push-action@v6
64- with :
65- context : .
66- file : .devcontainer/Dockerfile
67- platforms : linux/amd64
68- pull : true
69- push : true
70- tags : ${{ steps.meta_public.outputs.tags }}
71- labels : ${{ steps.meta_public.outputs.labels }}
72- target : compiled
73- build-args : |
74- BASE_IMAGE=${{ matrix.base_image }}
75- BRANCH=${{ env.BRANCH }}
76-
77-
78- build-arm-docker-image :
79- if : github.repository_owner == 'LCAS'
80- runs-on :
81- - lcas-runc
82- - runc
83- strategy :
84- fail-fast : false
85- matrix :
86- include :
87- - base_image : lcas.lincoln.ac.uk/lcas/limo_platform_arm64:1
88- ros_distro : humble
89- push_image : lcas.lincoln.ac.uk/devcontainer/ros2-teaching-arm64
9029
91- steps :
92- - name : Node Js
93- uses : actions/setup-node@v4
94- with :
95- node-version : " ^16.13.0 || >=18.0.0"
96-
9730 - uses : actions/checkout@v3
9831 with :
9932 fetch-depth : 1
@@ -108,20 +41,21 @@ jobs:
10841 registry : lcas.lincoln.ac.uk
10942 username : ${{ secrets.LCAS_REGISTRY_PUSHER }}
11043 password : ${{ secrets.LCAS_REGISTRY_TOKEN }}
111-
44+
45+ - name : " image name from repo name"
46+ id : docker_image_name
47+ run : echo "docker_image=${{ github.repository }}" | tr '[:upper:]' '[:lower:]' |sed 's/[^0-9,a-z,A-Z,=,_,\/]/-/g' >>${GITHUB_OUTPUT}
48+
11249 - name : Docker meta
11350 id : meta_public
11451 uses : docker/metadata-action@v5
11552 with :
116- flavor : |
117- latest=false
11853 # list of Docker images to use as base name for tags
11954 images : |
12055 ${{ matrix.push_image }}
12156 # generate Docker tags based on the following events/attributes
12257 tags : |
12358 type=raw,value=staging
124- type=raw,enable=${{ github.event_name != 'pull_request' }},value=latest
12559 type=ref,enable=${{ github.event_name != 'pull_request' }},event=branch
12660 type=semver,pattern={{version}}
12761 type=semver,pattern={{major}}.{{minor}}
@@ -132,13 +66,13 @@ jobs:
13266 with :
13367 context : .
13468 file : .devcontainer/Dockerfile
135- platforms : linux/arm64
136- pull : true
69+ platforms : linux/amd64,linux/arm64
13770 push : true
71+ cache-from : type=registry,ref=lcas.lincoln.ac.uk/cache/${{ steps.docker_image_name.outputs.docker_image }}:latest
72+ cache-to : type=registry,ref=lcas.lincoln.ac.uk/cache/${{ steps.docker_image_name.outputs.docker_image }}:latest,mode=max
13873 tags : ${{ steps.meta_public.outputs.tags }}
13974 labels : ${{ steps.meta_public.outputs.labels }}
14075 target : compiled
14176 build-args : |
14277 BASE_IMAGE=${{ matrix.base_image }}
14378 BRANCH=${{ env.BRANCH }}
144-
0 commit comments