wings/.github/workflows/docker.yml

56 lines
1.6 KiB
YAML
Raw Normal View History

2020-11-15 04:42:12 +00:00
name: Publish Docker Image
2020-12-15 22:59:06 +00:00
2020-11-15 04:42:12 +00:00
on:
push:
branches:
- 'develop'
tags:
- 'v*'
2020-12-15 22:59:06 +00:00
2020-11-15 04:42:12 +00:00
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'))"
2020-12-15 22:59:06 +00:00
2020-11-15 04:42:12 +00:00
steps:
2020-12-15 22:59:06 +00:00
- name: Code Checkout
uses: actions/checkout@v2
- 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 22:59:06 +00:00
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 22:59:06 +00:00
VERSION=${GITHUB_REF:11}
2020-11-15 04:42:12 +00:00
labels: ${{ steps.docker_meta.outputs.labels }}
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 22:59:06 +00:00
VERSION=dev-$(git rev-parse --short "$GITHUB_SHA"}
2020-11-15 04:42:12 +00:00
labels: ${{ steps.docker_meta.outputs.labels }}
2020-12-15 22:59:06 +00:00
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}