This commit is contained in:
bipproduction
2026-03-02 13:20:05 +08:00
parent 790d6535e5
commit 0ba30aa5b2
2 changed files with 57 additions and 1 deletions

57
.github/workflows/docker-publish.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
name: Docker Build & Publish
on:
push:
tags:
- "v*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value=latest
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BUN_PUBLIC_BASE_URL=${{ vars.BUN_PUBLIC_BASE_URL }}
cache-from: type=gha
cache-to: type=gha,mode=max