The workflow should work for forks also

This commit is contained in:
tcely 2025-03-18 09:31:43 -04:00 committed by GitHub
parent a904d60ad8
commit 4bc510bdad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,7 +34,10 @@ jobs:
- name: Run Django tests
run: cd tubesync && python3 manage.py test --verbosity=2
containerise:
if: ${{ always() }}
needs: test
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
@ -42,13 +45,18 @@ jobs:
id: buildx
uses: docker/setup-buildx-action@v3
- name: Log into GitHub Container Registry
run: echo "${{ secrets.REGISTRY_ACCESS_TOKEN }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin
env:
DOCKER_REGISTRY: https://ghcr.io
DOCKER_USERNAME: ${{ github.actor }}
DOCKER_TOKEN: ${{ 'meeb' == github.repository_owner && secrets.REGISTRY_ACCESS_TOKEN || secrets.GITHUB_TOKEN }}
run: echo '${{ env.DOCKER_TOKEN }}' | docker login --password-stdin --username '${{ env.DOCKER_USERNAME }}' '${{ env.DOCKER_REGISTRY }}'
- name: Lowercase github username for ghcr
id: string
uses: ASzc/change-string-case-action@v6
with:
string: ${{ github.actor }}
- name: Build and push
timeout-minutes: 60
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64