47 lines
1.2 KiB
YAML
47 lines
1.2 KiB
YAML
name: Docker Build & Push
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build:
|
|
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 into Forgejo Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: git.khoavo.myds.me
|
|
username: ${{ secrets.FORGEJO_USERNAME }}
|
|
password: ${{ secrets.FORGEJO_PASSWORD }}
|
|
|
|
- name: Extract metadata
|
|
id: meta
|
|
uses: docker/metadata-action@v5
|
|
with:
|
|
images: git.khoavo.myds.me/vndangkhoa/kv-tube
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=raw,value=latest,enable=${{ github.ref == 'refs/tags/v*' }}
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
platforms: linux/amd64
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|