File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change 11name : Publish Docker image to DockerHub
2+
23on :
34 push :
4- branches : [ dev ]
5+ branches : [dev]
56 pull_request :
6- branches : [ dev ]
7+ branches : [dev]
8+
9+ concurrency :
10+ group : docker-dev-${{ github.ref }}
11+ cancel-in-progress : true
712
813# https://docs.docker.com/build/ci/github-actions/multi-platform/
914jobs :
1015 docker :
1116 name : Build Docker Image and Publish (only on push)
1217 runs-on : ubuntu-latest
18+ permissions :
19+ contents : read
20+ actions : write
21+
1322 steps :
14-
1523 - name : Check out the repo
1624 uses : actions/checkout@v4
25+
1726 - name : Set up QEMU
1827 uses : docker/setup-qemu-action@v3
28+
1929 - name : Set up Docker Buildx
2030 uses : docker/setup-buildx-action@v3
31+
2132 - name : Login to Docker Hub
22- uses : docker/login-action@v3
2333 if : github.event_name == 'push'
34+ uses : docker/login-action@v3
2435 with :
2536 username : ${{ secrets.DOCKERHUB_USERNAME }}
2637 password : ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
38+
2739 - name : Build and push
28- uses : docker/build-push-action@v5
40+ uses : docker/build-push-action@v6
2941 with :
3042 context : .
31- platforms : linux/amd64,linux/arm64
43+ platforms : ${{ github.event_name == 'push' && ' linux/amd64,linux/arm64' || 'linux/amd64' }}
3244 push : ${{ github.event_name == 'push' }}
3345 tags : sysprog21/chisel-bootcamp:latest
46+ cache-from : type=gha
47+ cache-to : type=gha,mode=max
You can’t perform that action at this time.
0 commit comments