mirror of
https://github.com/mivodev/mivo.git
synced 2026-01-26 13:31:56 +07:00
feat: add GitHub Actions workflow for Docker image build and publish to GHCR and Docker Hub.
This commit is contained in:
5
.github/workflows/docker-publish.yml
vendored
5
.github/workflows/docker-publish.yml
vendored
@@ -13,6 +13,9 @@ env:
|
|||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
# github.repository as <account>/<repo>
|
# github.repository as <account>/<repo>
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
# Map secrets to env for availability in 'if' conditions
|
||||||
|
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -41,7 +44,7 @@ jobs:
|
|||||||
|
|
||||||
# Login against Docker Hub (Optional fallback if secrets exist)
|
# Login against Docker Hub (Optional fallback if secrets exist)
|
||||||
- name: Log into Docker Hub
|
- name: Log into Docker Hub
|
||||||
if: github.event_name != 'pull_request' && secrets.DOCKER_USERNAME != ''
|
if: github.event_name != 'pull_request' && env.DOCKER_USERNAME != ''
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: docker.io
|
registry: docker.io
|
||||||
|
|||||||
Reference in New Issue
Block a user