forked from farhoodlabs/paperclip
ci: replace docker/login-action with direct docker login using github.token
Fixes CAR-985: docker/login-action@v3 fails with Gitea automatic Actions token (returns 'unauthorized' on git.farh.net/v2/). Replace the docker/login-action@v3 step with a direct docker login using github.token piped via stdin. The github.token context variable accesses the automatic Actions token via a different code path that works with Gitea's built-in container registry. Changes: - .github/workflows/build-dev.yml: replace docker/login-action with direct 'echo github.token | docker login' - .github/workflows/build-prod.yml: same replacement - .gitea/workflows/build-dev.yml: same replacement - .gitea/workflows/build-prod.yml: same replacement cc @cpfarhood
This commit is contained in:
@@ -11,33 +11,23 @@ permissions:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: runners-farhoodlabs
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- name: Login to Gitea Registry
|
||||
run: echo "${{ github.token }}" | docker login git.farh.net -u "${{ github.actor }}" --password-stdin
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/farhoodlabs/paperclip
|
||||
images: git.farh.net/farhoodlabs/paperclip
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=sha,prefix=
|
||||
@@ -47,7 +37,8 @@ jobs:
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: .farhoodlabs/Dockerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
no-cache: true
|
||||
no-cache: true
|
||||
Reference in New Issue
Block a user