Files
leanderandClaude Opus 5.5 fa68481ef3 ci: publish a container image to ghcr.io on each release
Builds the image and pushes it to ghcr.io/uio-gaming/name-100-uio-gamers, tagged with the release version and latest. It runs as a job in the release-please workflow, because releases created with GITHUB_TOKEN don't trigger other workflows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:18:29 +01:00

63 lines
1.8 KiB
YAML

name: Release Please
on:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
jobs:
release-please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
version: ${{ steps.release.outputs.version }}
steps:
- uses: googleapis/release-please-action@v4
id: release
with:
config-file: release-please-config.json
manifest-file: .release-please-manifest.json
# Releases made by release-please don't trigger other workflows (GitHub ignores events
# created with GITHUB_TOKEN), so the image is published from here instead.
publish-image:
needs: release-please
if: needs.release-please.outputs.release_created == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v5
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/metadata-action@v5
id: meta
with:
images: ghcr.io/uio-gaming/name-100-uio-gamers
tags: |
type=semver,pattern={{version}},value=${{ needs.release-please.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ needs.release-please.outputs.version }}
type=semver,pattern={{major}},value=${{ needs.release-please.outputs.version }}
type=raw,value=latest
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max