Skip to content

Commit 8f183e6

Browse files
committed
Properly add the version to Docker builds
1 parent ef3f858 commit 8f183e6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/docker.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,54 @@
11
name: Publish Docker Image
2+
23
on:
34
push:
45
branches:
56
- 'develop'
67
tags:
78
- 'v*'
9+
810
jobs:
911
push_to_registry:
1012
name: Push Image to GitHub Packages
1113
runs-on: ubuntu-latest
14+
1215
# Always run against a tag, even if the commit into the tag has [docker skip]
1316
# within the commit message.
1417
if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))"
18+
1519
steps:
1620
- uses: actions/checkout@v2
21+
1722
- uses: crazy-max/ghaction-docker-meta@v1
1823
id: docker_meta
1924
with:
2025
images: ghcr.io/pterodactyl/panel
26+
2127
- uses: docker/setup-qemu-action@v1
28+
2229
- uses: docker/setup-buildx-action@v1
30+
2331
- uses: docker/login-action@v1
2432
with:
2533
registry: ghcr.io
2634
username: ${{ github.repository_owner }}
2735
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+
2844
- name: Release Production Build
2945
uses: docker/build-push-action@v2
3046
if: "!contains(github.ref, 'develop')"
3147
with:
3248
push: true
3349
tags: ${{ steps.docker_meta.outputs.tags }}
3450
labels: ${{ steps.docker_meta.outputs.labels }}
51+
3552
- name: Release Development Build
3653
uses: docker/build-push-action@v2
3754
if: "contains(github.ref, 'develop')"

0 commit comments

Comments
 (0)