feat: add GitHub Actions workflow for Docker image build and publish to GHCR and Docker Hub.

This commit is contained in:
MivoDev
2026-01-18 12:07:31 +07:00
parent d5939dc5a2
commit 74b258b12d

View File

@@ -13,6 +13,9 @@ env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}
# Map secrets to env for availability in 'if' conditions
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
jobs:
build:
@@ -41,7 +44,7 @@ jobs:
# Login against Docker Hub (Optional fallback if secrets exist)
- 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
with:
registry: docker.io