mirror of
https://github.com/jiangrui1994/CloudSaver.git
synced 2026-01-11 07:38:45 +08:00
build:完善构建流程
This commit is contained in:
17
.github/workflows/docker-build-test.yml
vendored
17
.github/workflows/docker-build-test.yml
vendored
@@ -1,17 +1,15 @@
|
||||
name: Build and Push Multi-Arch Docker Image for Test
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
workflow_dispatch: # 添加手动触发
|
||||
workflow_dispatch: # 添加手动触发
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write # 必须授权以推送镜像
|
||||
packages: write # 必须授权以推送镜像
|
||||
env:
|
||||
REPO_NAME: ${{ github.repository }}
|
||||
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
steps:
|
||||
- name: 检出代码
|
||||
uses: actions/checkout@v4
|
||||
@@ -28,6 +26,12 @@ jobs:
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: 登录到 Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
|
||||
- name: 设置 QEMU 支持多架构
|
||||
uses: docker/setup-qemu-action@v2
|
||||
|
||||
@@ -38,7 +42,8 @@ jobs:
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64 # 指定架构:x86_64 和 ARM64
|
||||
platforms: linux/amd64,linux/arm64 # 指定架构:x86_64 和 ARM64
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ env.LOWER_NAME }}:test
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/${{ env.LOWER_NAME }}:test
|
||||
|
||||
Reference in New Issue
Block a user