Skip to content

Docker

Docker #80

Workflow file for this run

name: Docker
on:
push:
branches:
- '*'
tags:
- '*'
release:
types:
- published
pull_request_review:
types:
- submitted
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=match,pattern=v(.*),group=1
type=ref,event=branch
- uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
cache-to: type=inline
push: ${{ ((github.event_name == 'push' || github.event_name == 'workflow_run') && github.ref == 'refs/heads/master') || github.event_name == 'release' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
auto-pr-handling:
needs: build-and-push-image
if: github.event.review.state == 'approved'
runs-on: ubuntu-latest
steps:
- uses: TimonVS/pr-labeler-action@v4
with:
configuration-path: .github/auto_label.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: pascalgn/automerge-action@v0.15.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MERGE_LABELS: "automerge,!WIP,!do-not-merge"
MERGE_METHOD: squash