ci(forgejo): configure act-runner container image and registry host
This commit is contained in:
parent
a3fd5f212e
commit
6fce3d218e
1 changed files with 13 additions and 2 deletions
|
|
@ -12,17 +12,26 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to Forgejo Container Registry
|
- name: Log in to Forgejo Container Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ gitea.server_url }}
|
registry: ${{ steps.reg.outputs.host }}
|
||||||
username: ${{ gitea.actor }}
|
username: ${{ gitea.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
|
@ -30,7 +39,7 @@ jobs:
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v5
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ gitea.server_url }}/${{ gitea.repository }}
|
images: ${{ steps.reg.outputs.host }}/${{ gitea.repository }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' || gitea.ref == 'refs/heads/master' }}
|
type=raw,value=latest,enable=${{ gitea.ref == 'refs/heads/main' || gitea.ref == 'refs/heads/master' }}
|
||||||
type=ref,event=branch
|
type=ref,event=branch
|
||||||
|
|
@ -51,6 +60,8 @@ jobs:
|
||||||
needs: build-and-push
|
needs: build-and-push
|
||||||
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/v')
|
if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') || startsWith(github.ref, 'refs/tags/v')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: catthehacker/ubuntu:act-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
|
||||||
Reference in a new issue