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