Build container #326
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build container | |
on: | |
push: | |
pull_request: | |
# Build regularly in order to have up to date base images in the edge image | |
schedule: | |
- cron: '42 2 * * 6' # weekly on Saturday 2:42 UTC | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: docker/metadata-action@v5 | |
id: meta | |
with: | |
images: | | |
ghcr.io/${{ github.repository }} | |
tags: | | |
type=edge | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }} | |
- uses: docker/setup-qemu-action@v3 | |
- uses: docker/setup-buildx-action@v3 | |
- name: Login to GHCR | |
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/build-push-action@v5 | |
with: | |
platforms: linux/amd64 | |
push: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} |