mirror of
https://github.com/vas3k/TaxHacker.git
synced 2026-07-08 15:06:34 +08:00
77 lines
2.0 KiB
YAML
77 lines
2.0 KiB
YAML
name: Build and Publish Version Tagged Docker Image
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
build-and-push:
|
|
name: Build and Push to GHCR
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 26
|
|
cache: npm
|
|
|
|
- name: Generate Prisma client natively
|
|
run: npm ci && npx prisma generate
|
|
|
|
- name: Set up QEMU for multi-platform builds
|
|
uses: docker/setup-qemu-action@v4.1.0
|
|
|
|
- name: Set up Node.js
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 26
|
|
cache: npm
|
|
|
|
- name: Generate Prisma client natively
|
|
run: npm ci && npx prisma generate
|
|
|
|
- name: Set up QEMU for multi-platform builds
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4.1.0
|
|
|
|
- name: Log in to GitHub Container Registry
|
|
uses: docker/login-action@v4.2.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Extract metadata for Docker
|
|
id: meta
|
|
uses: docker/metadata-action@v6.1.0
|
|
with:
|
|
images: ghcr.io/${{ github.repository_owner }}/taxhacker
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v7.2.0
|
|
with:
|
|
context: .
|
|
push: true
|
|
platforms: linux/amd64,linux/arm64
|
|
tags: ${{ steps.meta.outputs.tags }}
|
|
labels: ${{ steps.meta.outputs.labels }}
|
|
build-args: |
|
|
SKIP_PRISMA_GENERATE=true
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|