Updated action to use a pat due to failure otherwise, fixed cache issue
Container image / image (push) Successful in 3m17s
Container image / image (push) Successful in 3m17s
This commit is contained in:
@@ -42,17 +42,27 @@ jobs:
|
|||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
with:
|
||||||
|
# Skip the GHA-cache lookup for the binfmt image. The Gitea
|
||||||
|
# runner has no GHA cache server, so the action would
|
||||||
|
# otherwise sit in a ~5-minute TCP timeout before falling
|
||||||
|
# back to a direct docker pull. Going straight to pull
|
||||||
|
# cuts QEMU setup from ~5 min to ~15 s.
|
||||||
|
cache-image: false
|
||||||
|
|
||||||
- name: Set up Buildx
|
- name: Set up Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
# github.repository is owner/name in the repo's original casing;
|
# Registries want lowercase namespaces, and Gitea's container
|
||||||
# registries require lowercase. Normalise once and reuse below.
|
# registry is case-sensitive on the login username too. Lowercase
|
||||||
|
# both repo path and actor once here and reuse below.
|
||||||
- name: Resolve image name
|
- name: Resolve image name
|
||||||
id: img
|
id: img
|
||||||
run: |
|
run: |
|
||||||
repo='${{ github.repository }}'
|
repo='${{ github.repository }}'
|
||||||
|
actor='${{ github.actor }}'
|
||||||
echo "ref=git.cer.sh/${repo,,}" >> "$GITHUB_OUTPUT"
|
echo "ref=git.cer.sh/${repo,,}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "user=${actor,,}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
# Version stamp baked into the binary via -ldflags. Tag pushes
|
# Version stamp baked into the binary via -ldflags. Tag pushes
|
||||||
# use the tag name directly; everything else gets a short SHA
|
# use the tag name directly; everything else gets a short SHA
|
||||||
@@ -67,13 +77,20 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
echo "version=$v" >> "$GITHUB_OUTPUT"
|
echo "version=$v" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
# Prefers a user-provided PAT (repo secret REGISTRY_TOKEN with
|
||||||
|
# `write:package` scope) and falls back to the auto-injected
|
||||||
|
# runner token. The auto-token works on Gitea >= 1.21 when the
|
||||||
|
# workflow declares `packages: write` in permissions, but if
|
||||||
|
# the registry still rejects it (older instance, container
|
||||||
|
# registry gated by config, etc.), REGISTRY_TOKEN takes over
|
||||||
|
# without any workflow edits.
|
||||||
- name: Login to Gitea registry
|
- name: Login to Gitea registry
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: git.cer.sh
|
registry: git.cer.sh
|
||||||
username: ${{ github.actor }}
|
username: ${{ steps.img.outputs.user }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.REGISTRY_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Docker metadata
|
- name: Docker metadata
|
||||||
id: meta
|
id: meta
|
||||||
|
|||||||
Reference in New Issue
Block a user