Skip to content

Add image build workflow #1

Add image build workflow

Add image build workflow #1

Workflow file for this run

name: Build docker image
on:
push:
branches: ["*"]
tags: ["v*"]
jobs:
docker-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/metadata-action@v4
id: meta
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=sha,prefix={{branch}}-,enable=${{ github.ref_type != 'tag' }}
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}