-
-
Notifications
You must be signed in to change notification settings - Fork 322
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for automated docker build
- Loading branch information
1 parent
d970ec3
commit 82b23ef
Showing
6 changed files
with
68 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: Publish Docker Image | ||
on: | ||
push: | ||
branches: | ||
- 'develop' | ||
tags: | ||
- 'v*' | ||
jobs: | ||
push_to_registry: | ||
name: Push Image to GitHub Packages | ||
runs-on: ubuntu-latest | ||
# Always run against a tag, even if the commit into the tag has [docker skip] | ||
# within the commit message. | ||
if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))" | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: crazy-max/ghaction-docker-meta@v1 | ||
id: docker_meta | ||
with: | ||
images: ghcr.io/pterodactyl/wings | ||
- uses: docker/setup-qemu-action@v1 | ||
- uses: docker/setup-buildx-action@v1 | ||
- uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.REGISTRY_TOKEN }} | ||
- name: Release Production Build | ||
uses: docker/build-push-action@v2 | ||
if: "!contains(github.ref, 'develop')" | ||
env: | ||
REF: ${{ github.ref }} | ||
with: | ||
push: true | ||
build-args: | | ||
VERSION=${REF:11} | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} | ||
- name: Release Development Build | ||
uses: docker/build-push-action@v2 | ||
if: "contains(github.ref, 'develop')" | ||
with: | ||
push: ${{ github.event_name != 'pull_request' }} | ||
build-args: | | ||
VERSION=dev-${GIT_COMMIT:0:7} | ||
tags: ${{ steps.docker_meta.outputs.tags }} | ||
labels: ${{ steps.docker_meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
name: "Release" | ||
|
||
name: Create Release | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-20.04 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters