mash-playbook/.github/workflows/workflow.yml

40 lines
1.1 KiB
YAML
Raw Normal View History

2024-09-15 19:17:46 +02:00
name: CI (main and tags)
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
permissions:
checks: write
contents: write
packages: write
pull-requests: read
jobs:
build-publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest,enable=${{ github.ref_name == 'main' }}
type=semver,pattern={{raw}}
- name: Build and push
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
2024-09-15 19:19:06 +02:00
context: .
2024-09-15 19:17:46 +02:00
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}