From 59e795f4534922045d01c3a406dc72c87faed94d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=98=89=E4=BC=9F?= <8473136@qq.com> Date: Mon, 16 Mar 2026 17:43:41 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=9A=20Update=20GitHub=20Actions=20work?= =?UTF-8?q?flow=20configuration.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 41 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb2beb7..2d3173f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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