hugo-to-gemini/.github/workflows/docker.yml
Timur Demin 6f3720a4ae
Reorganize GHCR workflows
This removes the manual build workflow, unifying it with the automatic
GHCR release workflow and ensuring Docker images are autobuilt.
2022-03-20 00:03:33 +05:00

45 lines
1.2 KiB
YAML

name: Push to GHCR
on:
push:
tags:
- '*'
workflow_dispatch:
inputs:
tag:
required: true
description: "Build specific tag"
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Set tag name from manual dispatch
if: ${{ github.event_name == "workflow_dispatch" }}
run: |
echo "tag_name=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
- name: Set tag name from Git
if: ${{ github.event_name == "push" }}
run: |
echo "tag_name=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ env.tag_name }}
- name: Set up Buildx
uses: docker/setup-buildx-action@v1
- name: Login to registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build & push
uses: docker/build-push-action@v2
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
ghcr.io/${{ github.repository }}:latest
ghcr.io/${{ github.repository }}:${{ env.tag_name }}