77 - ' v*'
88jobs :
99 push_to_registry :
10- name : Push Image to Github Packages
10+ name : Push Image to GitHub Packages
1111 runs-on : ubuntu-latest
12+ # Always run against a tag, even if the commit into the tag has [docker skip]
13+ # within the commit message.
14+ if : " !contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))"
1215 steps :
1316 - uses : actions/checkout@v2
17+ - uses : crazy-max/ghaction-docker-meta@v1
18+ id : docker_meta
19+ with :
20+ images : ghcr.io/pterodactyl/panel
1421 - uses : docker/setup-qemu-action@v1
1522 - uses : docker/setup-buildx-action@v1
1623 - uses : docker/login-action@v1
@@ -20,18 +27,15 @@ jobs:
2027 password : ${{ secrets.REGISTRY_TOKEN }}
2128 - name : Release Production Build
2229 uses : docker/build-push-action@v2
23- if : contains(github.ref, 'develop') != true
24- env :
25- GITHUB_REF : ${{ github.ref }}
30+ if : " !contains(github.ref, 'develop')"
2631 with :
2732 push : true
28- tags : |
29- ghcr.io/pterodactyl/panel:latest
30- ghcr.io/pterodactyl/panel:${GITHUB_REF}
33+ tags : ${{ steps.docker_meta.outputs.tags }}
34+ labels : ${{ steps.docker_meta.outputs.labels }}
3135 - name : Release Development Build
3236 uses : docker/build-push-action@v2
33- if : contains(github.ref, 'develop') && && !contains(github.event.head_commit.message, '[skip docker]') && !contains(github.event.head_commit.message, '[docker skip]')
37+ if : " contains(github.ref, 'develop')"
3438 with :
35- push : true
36- tags : |
37- ghcr.io/pterodactyl/panel:develop
39+ push : ${{ github.event_name != 'pull_request' }}
40+ tags : ${{ steps.docker_meta.outputs.tags }}
41+ labels : ${{ steps.docker_meta.outputs.labels }}
0 commit comments