make workflow more generic
All checks were successful
Build and Push Docker Image to GHCR / build-and-push (push) Successful in 31s
All checks were successful
Build and Push Docker Image to GHCR / build-and-push (push) Successful in 31s
This commit is contained in:
9
.github/workflows/docker-publish.yml
vendored
9
.github/workflows/docker-publish.yml
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user