@@ -3,8 +3,10 @@ name: Publish Docker Image
33on :
44 push :
55 branches :
6- - " develop"
7- - " release/v*"
6+ - develop
7+ release :
8+ types :
9+ - published
810
911jobs :
1012 push :
@@ -17,45 +19,49 @@ jobs:
1719 - name : Code Checkout
1820 uses : actions/checkout@v3
1921
20- - name : Docker Metadata
21- uses : docker/metadata-action@v4
22+ - name : Docker metadata
2223 id : docker_meta
24+ uses : docker/metadata-action@v4
2325 with :
2426 images : ghcr.io/pterodactyl/panel
27+ tags : |
28+ type=raw,value=latest,enable=${{ github.event_name == 'release' && github.event.action == 'published' && github.event.release.prerelease == false }}
29+ type=ref,event=tag
30+ type=ref,event=branch
2531
2632 - name : Setup QEMU
2733 uses : docker/setup-qemu-action@v2
2834
29- - name : Setup Docker Buildx
35+ - name : Setup Docker buildx
3036 uses : docker/setup-buildx-action@v2
3137
32- - name : Docker Login
38+ - name : Login to GitHub Container Registry
3339 uses : docker/login-action@v2
3440 with :
3541 registry : ghcr.io
3642 username : ${{ github.repository_owner }}
3743 password : ${{ secrets.REGISTRY_TOKEN }}
3844
39- - name : Release production build
40- uses : docker/build-push-action@v2
41- if : " contains( github.ref, 'release/v') "
45+ - name : Build and Push (tag)
46+ uses : docker/build-push-action@v3
47+ if : " github.event_name == 'release' && github.event.action == 'published' "
4248 with :
4349 context : .
4450 file : ./Dockerfile
4551 push : true
4652 platforms : linux/amd64,linux/arm64
47- tags : ${{ steps.docker_meta.outputs.tags }}
4853 labels : ${{ steps.docker_meta.outputs.labels }}
54+ tags : ${{ steps.docker_meta.outputs.tags }}
4955
50- - name : Release development build
51- uses : docker/build-push-action@v2
52- if : " contains(github.ref, 'develop')"
56+ - name : Build and Push (develop)
57+ uses : docker/build-push-action@v3
58+ if : " github.event_name == 'push' && contains(github.ref, 'develop')"
5359 with :
5460 context : .
5561 file : ./Dockerfile
5662 push : ${{ github.event_name != 'pull_request' }}
5763 platforms : linux/amd64,linux/arm64
58- tags : ${{ steps.docker_meta.outputs.tags }}
5964 labels : ${{ steps.docker_meta.outputs.labels }}
65+ tags : ${{ steps.docker_meta.outputs.tags }}
6066 cache-from : type=gha
6167 cache-to : type=gha,mode=max
0 commit comments