@@ -20,19 +20,32 @@ jobs:
2020 matrix :
2121 variant :
2222 - name : public
23- config_branch : main
24- suffix : " -readonly"
25- edit : " true"
23+ image_suffix : " "
24+ tag_suffix : " -readonly"
25+ target : " "
26+ build_args : |
27+ VITE_DEFAULT_CONFIGURATION=https://s3-ext-1.nina.no/dms/maps/main/maps.json
28+ VITE_HIDE_EDIT_BUTTON=true
2629 - name : internal
27- config_branch : main
28- suffix : " "
29- edit : " false"
30+ image_suffix : " "
31+ tag_suffix : " "
32+ target : " "
33+ build_args : |
34+ VITE_DEFAULT_CONFIGURATION=https://s3-ext-1.nina.no/dms/maps/main/maps.json
35+ VITE_HIDE_EDIT_BUTTON=false
36+ - name : server
37+ image_suffix : " -server"
38+ tag_suffix : " "
39+ target : " server"
40+ build_args : " "
3041
3142 steps :
3243 - name : Checkout repository
3344 uses : actions/checkout@v3
3445 with :
3546 persist-credentials : false
47+ - name : Setup Buildx
48+ uses : docker/setup-buildx-action@v3
3649 - name : Login to registry
3750 if : github.event_name != 'pull_request'
3851 uses : docker/login-action@v2
@@ -44,17 +57,19 @@ jobs:
4457 id : meta
4558 uses : docker/metadata-action@v4
4659 with :
47- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
60+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}${{ matrix.variant.image_suffix }}
4861 tags : |
49- type=ref,event=branch,suffix=${{ matrix.variant.suffix }}
50- type=sha,suffix=${{ matrix.variant.suffix }}
62+ type=ref,event=branch,suffix=${{ matrix.variant.tag_suffix }}
63+ type=sha,suffix=${{ matrix.variant.tag_suffix }}
64+ type=semver,pattern={{version}},suffix=${{ matrix.variant.tag_suffix }}
5165 - name : Build and push Docker image
5266 uses : docker/build-push-action@v3
5367 with :
5468 context : .
55- push : ${{ github.event_name != 'pull_request' }}
69+ target : ${{ matrix.variant.target }}
70+ push : ${{ github.event_name != 'pull_request' }}
5671 tags : ${{ steps.meta.outputs.tags }}
5772 labels : ${{ steps.meta.outputs.labels }}
58- build-args : |
59- VITE_DEFAULT_CONFIGURATION=https://s3-ext-1.nina.no/dms/maps/ ${{ matrix.variant.config_branch }}/maps.json
60- VITE_HIDE_EDIT_BUTTON= ${{ matrix.variant.edit }}
73+ build-args : ${{ matrix.variant.build_args }}
74+ cache-from : type=gha,scope= ${{ matrix.variant.name }}
75+ cache-to : type=gha,mode=max,scope= ${{ matrix.variant.name }}
0 commit comments