Skip to content

Merge remote-tracking branch 'upstream/main' #33

Merge remote-tracking branch 'upstream/main'

Merge remote-tracking branch 'upstream/main' #33

Workflow file for this run

name: Docker build
on:
workflow_dispatch:
push:
branches:
- main
- develop
release:
types:
- published
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
docker_build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
-
uses: actions/checkout@v3
-
name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# generate Docker tags based on the following events/attributes
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build, cache and push docker image
uses: docker/build-push-action@v3
with:
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max