💚 Update GitHub Actions workflow configuration.

This commit is contained in:
刘嘉伟 committed 2026-03-16 17:43:41 +08:00
1 parent 447cb7930c
commit 59e795f453
1 file changed
+41
+41
View File
@@ -4,6 +4,7 @@ on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
@@ -83,3 +84,43 @@ jobs:
-ldflags "-s -w -X main.Version=ci -X main.BuildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
-o /tmp/podux \
main.go
# ──────────────────────────────────────────────
# Docker: build & push :dev image (dev branch only)
# ──────────────────────────────────────────────
docker-dev:
name: Docker (dev tag)
if: github.ref == 'refs/heads/dev' && github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ghcr.io/${{ github.repository }}:dev
build-args: |
VERSION=dev
BUILD_TIME=${{ github.event.head_commit.timestamp }}
cache-from: type=gha
cache-to: type=gha,mode=max