spotify-clone/.github/workflows/docker-publish.yml

37 lines
940 B
YAML

name: Build and Publish Docker Image
on:
push:
branches: [ "main" ]
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to Forgejo Registry
uses: docker/login-action@v3
with:
registry: git.khoavo.myds.me
username: vndangkhoa
password: ${{ secrets.FORGEJO_TOKEN || 'Thieugia19' }} # Fallback to provided password if secret not set
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
git.khoavo.myds.me/vndangkhoa/spotify-clone:v3
git.khoavo.myds.me/vndangkhoa/spotify-clone:latest
platforms: linux/amd64