diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index ca94dbb..cae9e4e 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -1,5 +1,8 @@ name: Build and Push Docker Image to GHCR +env: + OCI_TOKEN: ${{ secrets.OCI_TOKEN || secrets.GITHUB_TOKEN }} + on: push: branches: ["main"] @@ -20,15 +23,15 @@ jobs: - name: Log in to GHCR uses: docker/login-action@v3 with: - registry: ghcr.io + registry: ${{ vars.OCI_REGISTRY || 'ghcr.io' }} username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + password: ${{ env.OCI_TOKEN }} - name: Extract Docker metadata id: meta uses: docker/metadata-action@v5 with: - images: ghcr.io/${{ github.repository }} + images: ${{ vars.OCI_REGISTRY || 'ghcr.io' }}/${{ github.repository }} - name: Build and push Docker image uses: docker/build-push-action@v6