|
1 | 1 | name: Publish Docker Image |
2 | | - |
3 | 2 | on: |
4 | 3 | push: |
5 | 4 | branches: |
6 | 5 | - 'develop' |
7 | 6 | tags: |
8 | 7 | - 'v*' |
9 | | - |
10 | 8 | jobs: |
11 | 9 | push_to_registry: |
12 | 10 | name: Push Image to GitHub Packages |
13 | 11 | runs-on: ubuntu-latest |
14 | | - |
15 | 12 | # Always run against a tag, even if the commit into the tag has [docker skip] |
16 | 13 | # within the commit message. |
17 | 14 | if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))" |
18 | | - |
19 | 15 | steps: |
20 | 16 | - uses: actions/checkout@v2 |
21 | | - |
22 | 17 | - uses: crazy-max/ghaction-docker-meta@v1 |
23 | 18 | id: docker_meta |
24 | 19 | with: |
25 | 20 | images: ghcr.io/pterodactyl/panel |
26 | | - |
27 | 21 | - uses: docker/setup-qemu-action@v1 |
28 | | - |
29 | 22 | - uses: docker/setup-buildx-action@v1 |
30 | | - |
31 | 23 | - uses: docker/login-action@v1 |
32 | 24 | with: |
33 | 25 | registry: ghcr.io |
34 | 26 | username: ${{ github.repository_owner }} |
35 | 27 | password: ${{ secrets.REGISTRY_TOKEN }} |
36 | | - |
37 | 28 | - name: Bump Version |
38 | 29 | if: "!contains(github.ref, 'develop')" |
39 | 30 | env: |
40 | 31 | REF: ${{ github.ref }} |
41 | 32 | run: | |
42 | 33 | sed -i "s/ 'version' => 'canary',/ 'version' => '${REF:11}',/" config/app.php |
43 | | -
|
44 | 34 | - name: Release Production Build |
45 | 35 | uses: docker/build-push-action@v2 |
46 | 36 | if: "!contains(github.ref, 'develop')" |
47 | 37 | with: |
48 | 38 | push: true |
49 | 39 | tags: ${{ steps.docker_meta.outputs.tags }} |
50 | 40 | labels: ${{ steps.docker_meta.outputs.labels }} |
51 | | - |
52 | 41 | - name: Release Development Build |
53 | 42 | uses: docker/build-push-action@v2 |
54 | 43 | if: "contains(github.ref, 'develop')" |
|
0 commit comments