ci(forgejo): configure act-runner container image, registry host, and package permissions
Some checks failed
Build, Push, and Release / build-and-push (push) Failing after 55s
Build, Push, and Release / create-release (push) Has been skipped

This commit is contained in:
Tibo De Peuter 2026-08-18 18:38:34 +02:00
parent a3fd5f212e
commit 4f40574119

View file

@ -9,20 +9,37 @@ on:
tags:
- 'v*'
# Grant permissions to push packages to Forgejo Container Registry and create releases
permissions:
contents: write
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Extract Registry Host
id: reg
run: |
# Strip protocol scheme (http:// or https://) for Docker registry reference
SERVER_HOST=$(echo "${{ gitea.server_url }}" | sed -e 's|^https\?://||')
echo "host=${SERVER_HOST}" >> "$GITHUB_OUTPUT"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Forgejo Container Registry
uses: docker/login-action@v3
with:
registry: ${{ gitea.server_url }}
registry: ${{ steps.reg.outputs.host }}
username: ${{ gitea.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
@ -30,7 +47,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ gitea.server_url }}/${{ gitea.repository }}
images: ${{ steps.reg.outputs.host }}/${{ gitea.repository }}
tags: |
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' || gitea.ref == 'refs/heads/master' }}
type=ref,event=branch
@ -51,6 +68,10 @@ jobs:
needs: build-and-push
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
permissions:
contents: write
steps:
- name: Checkout Repository
uses: actions/checkout@v4