Run go-makefile-maker #55
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
################################################################################ | |
# This file is AUTOGENERATED with <https://github.com/sapcc/go-makefile-maker> # | |
# Edit Makefile.maker.yaml instead. # | |
################################################################################ | |
name: Container Registry GHCR | |
"on": | |
push: | |
branches: | |
- master | |
tags: | |
- '*' | |
permissions: | |
contents: read | |
packages: write | |
jobs: | |
build-and-push-image: | |
name: Push container to ghcr.io | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@v2 | |
with: | |
password: ${{ secrets.GITHUB_TOKEN }} | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ghcr.io/${{ github.repository }} | |
tags: |- | |
# https://github.com/docker/metadata-action#latest-tag | |
type=raw,value=latest,enable={{is_default_branch}} | |
# https://github.com/docker/metadata-action#typesemver | |
type=semver,pattern={{raw}} | |
type=semver,pattern=v{{major}}.{{minor}} | |
type=semver,pattern=v{{major}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
labels: ${{ steps.meta.outputs.labels }} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} |