wings/.github/workflows/docker.yml

59 lines
2.1 KiB
YAML
Raw Normal View History

2020-11-15 04:42:12 +00:00
name: Publish Docker Image
on:
push:
branches:
- develop
2020-11-15 04:42:12 +00:00
tags:
- 'v*'
jobs:
2020-12-15 22:59:06 +00:00
push:
name: Push
runs-on: ubuntu-20.04
# Always run against a tag, even if the commit into the tag has [docker skip] within the commit message.
2020-11-15 04:42:12 +00:00
if: "!contains(github.ref, 'develop') || (!contains(github.event.head_commit.message, 'skip docker') && !contains(github.event.head_commit.message, 'docker skip'))"
steps:
2020-12-15 22:59:06 +00:00
- name: Code Checkout
uses: actions/checkout@v2
2020-12-15 23:08:06 +00:00
- name: Docker Meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/pterodactyl/wings
2020-12-15 22:59:06 +00:00
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Install buildx
uses: docker/setup-buildx-action@v1
2020-11-15 04:42:12 +00:00
with:
2020-12-15 22:59:06 +00:00
version: v0.5.1
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
2020-11-15 04:42:12 +00:00
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.REGISTRY_TOKEN }}
2020-12-15 23:24:15 +00:00
- name: Get Build Information
id: build_info
run: |
echo "::set-output name=version_tag::${GITHUB_REF/refs\/tags\/v/}"
2020-12-15 23:24:15 +00:00
echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"
2020-11-15 04:42:12 +00:00
- name: Release Production Build
uses: docker/build-push-action@v2
if: "!contains(github.ref, 'develop')"
with:
build-args: |
2020-12-15 23:24:15 +00:00
VERSION=${{ steps.build_info.outputs.version_tag }}
2020-11-15 04:42:12 +00:00
labels: ${{ steps.docker_meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
2020-12-15 22:59:06 +00:00
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
2020-11-15 04:42:12 +00:00
- name: Release Development Build
uses: docker/build-push-action@v2
if: "contains(github.ref, 'develop')"
with:
build-args: |
2020-12-15 23:24:15 +00:00
VERSION=dev-${{ steps.build_info.outputs.short_sha }}
2020-11-15 04:42:12 +00:00
labels: ${{ steps.docker_meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
2020-12-15 22:59:06 +00:00
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}