2020-11-15 03:56:43 +00:00
|
|
|
name: Publish Docker Image
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'develop'
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
jobs:
|
|
|
|
push_to_registry:
|
2020-11-15 04:46:37 +00:00
|
|
|
name: Push Image to GitHub Packages
|
2020-11-15 03:56:43 +00:00
|
|
|
runs-on: ubuntu-latest
|
2020-11-15 04:46:37 +00:00
|
|
|
# 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'))"
|
2020-11-15 03:56:43 +00:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2020-11-15 04:46:37 +00:00
|
|
|
- uses: crazy-max/ghaction-docker-meta@v1
|
|
|
|
id: docker_meta
|
|
|
|
with:
|
|
|
|
images: ghcr.io/pterodactyl/panel
|
2020-11-15 03:56:43 +00:00
|
|
|
- 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
|
2020-11-15 04:46:37 +00:00
|
|
|
if: "!contains(github.ref, 'develop')"
|
2020-11-15 03:56:43 +00:00
|
|
|
with:
|
|
|
|
push: true
|
2020-11-15 04:46:37 +00:00
|
|
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|
2020-11-15 03:56:43 +00:00
|
|
|
- name: Release Development Build
|
|
|
|
uses: docker/build-push-action@v2
|
2020-11-15 04:46:37 +00:00
|
|
|
if: "contains(github.ref, 'develop')"
|
2020-11-15 03:56:43 +00:00
|
|
|
with:
|
2020-11-15 04:46:37 +00:00
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
tags: ${{ steps.docker_meta.outputs.tags }}
|
|
|
|
labels: ${{ steps.docker_meta.outputs.labels }}
|