make workflow more generic
All checks were successful
Build and Push Docker Image to GHCR / build-and-push (push) Successful in 31s

This commit is contained in:
Zoe
2025-09-24 16:07:17 +00:00
parent b75337f450
commit 83512c3584

View File

@@ -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