1313
1414env :
1515 REGISTRY : ghcr.io
16- IMAGE_NAME : ${{ github.repository }}
16+ IMAGE_NAME_APP : ${{ github.repository }}-app
17+ IMAGE_NAME_WEB : ${{ github.repository }}-web
1718
1819jobs :
1920 build :
@@ -37,26 +38,50 @@ jobs:
3738 username : ${{ github.actor }}
3839 password : ${{ secrets.GITHUB_TOKEN }}
3940
40- - name : Extract metadata
41- id : meta
41+ - name : Extract metadata (app)
42+ id : meta_app
4243 uses : docker/metadata-action@v5
4344 with :
44- images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
45+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_APP }}
4546 tags : |
4647 type=ref,event=branch
4748 type=ref,event=pr
4849 type=sha,prefix={{branch}}-
4950 type=raw,value=latest,enable={{is_default_branch}}
5051 type=semver,pattern={{version}}
5152 type=semver,pattern={{major}}.{{minor}}
52-
53- - name : Build and push Docker image
53+
54+ - name : Build and push Docker image (app)
55+ uses : docker/build-push-action@v6
56+ with :
57+ context : .docker/app
58+ platforms : linux/amd64,linux/arm64
59+ push : true
60+ tags : ${{ steps.meta_app.outputs.tags }}
61+ labels : ${{ steps.meta_app.outputs.labels }}
62+ cache-from : type=gha
63+ cache-to : type=gha,mode=max
64+
65+ - name : Extract metadata (web)
66+ id : meta_web
67+ uses : docker/metadata-action@v5
68+ with :
69+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME_WEB }}
70+ tags : |
71+ type=ref,event=branch
72+ type=ref,event=pr
73+ type=sha,prefix={{branch}}-
74+ type=raw,value=latest,enable={{is_default_branch}}
75+ type=semver,pattern={{version}}
76+ type=semver,pattern={{major}}.{{minor}}
77+
78+ - name : Build and push Docker image (web)
5479 uses : docker/build-push-action@v6
5580 with :
56- context : .
81+ context : .docker/web
5782 platforms : linux/amd64,linux/arm64
5883 push : true
59- tags : ${{ steps.meta .outputs.tags }}
60- labels : ${{ steps.meta .outputs.labels }}
84+ tags : ${{ steps.meta_web .outputs.tags }}
85+ labels : ${{ steps.meta_web .outputs.labels }}
6186 cache-from : type=gha
6287 cache-to : type=gha,mode=max
0 commit comments