File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77 paths :
88 - ' build/dockerfile'
99 - ' build/requirements.txt'
10+ - ' build/docker-compose.yml'
1011 - ' .github/workflows/build-docker-image.yml'
1112
1213jobs :
1314 build-and-push :
1415 runs-on : ubuntu-latest
16+ permissions :
17+ contents : read
18+ packages : write
1519
1620 steps :
1721 - name : Checkout repository
1822 uses : actions/checkout@v4
1923
24+ - name : Docker metadata
25+ id : meta
26+ uses : docker/metadata-action@v5
27+ with :
28+ images : ghcr.io/${{ toLower(github.repository) }}
29+ tags : |
30+ type=raw,value=latest,enable={{is_default_branch}}
31+ type=sha
32+
33+ - name : Set up Docker buildx
34+ uses : docker/setup-buildx-action@v3
35+
2036 - name : Log in to GitHub Container Registry
2137 uses : docker/login-action@v3
2238 with :
2339 registry : ghcr.io
2440 username : ${{ github.actor }}
2541 password : ${{ secrets.GITHUB_TOKEN }}
2642
27- - name : Build and push docker image
28- uses : docker/build-push -action@v5
43+ - name : Build and push via Docker compose
44+ uses : docker/bake -action@v5
2945 with :
30- context : ./
31- dockerfile : build/dockerfile
46+ files : build/docker-compose.yml
47+ targets : app
48+ set : |
49+ *.tags=${{ steps.meta.outputs.tags }}
50+ *.labels=${{ steps.meta.outputs.labels }}
3251 push : true
33- tags : ghcr.io/${{ github.repository }}:${{ github.sha }}, ghcr.io/${{ github.repository }}:latest
52+
Original file line number Diff line number Diff line change @@ -2,6 +2,9 @@ version: '3.8'
22
33services :
44 backend :
5+ build :
6+ context : .
7+ dockerfile : build/dockerfile
58 image : ghcr.io/pyhpc/pyhpc-tutorial:latest
69 pull_policy : always
710 ulimits :
You can’t perform that action at this time.
0 commit comments