Merge pull request #43 from Yiling-J/chore-add-release-workflow-7734661522119203214

Add Release Workflow for Docker Hub
This commit is contained in:
Yiling-J authored and GitHub committed 2026-02-18 21:00:49 +08:00
commit 6411eb1e68
1 file changed
+53
+53
View File
@@ -0,0 +1,53 @@
name: Release
on:
push:
branches: [ "main" ]
tags: [ "v*" ]
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Set up QEMU for multi-platform builds
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Log in to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: yilingj
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: yilingj/forgery
tags: |
type=semver,pattern={{version}}
type=ref,event=branch
type=sha
# Build and push Docker image
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64