Skip to content

Commit 52b2b4d

Browse files
committed
chore(all): 添加自动构建和修改相关配置
1 parent 14051b2 commit 52b2b4d

5 files changed

Lines changed: 600 additions & 38 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: docker-image
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # 当推送 v* 标签时触发,如 v1.0.0
7+
workflow_dispatch: # 允许手动触发
8+
inputs:
9+
tag:
10+
description: 'Release tag (e.g., v1.0.0)'
11+
required: true
12+
type: string
13+
14+
env:
15+
APP_NAME: cloudpan189-share
16+
DOCKERHUB_REPO: xxcheng123/cloudpan189-share
17+
18+
jobs:
19+
docker:
20+
runs-on: ubuntu-latest
21+
steps:
22+
-
23+
name: Checkout
24+
uses: actions/checkout@v2
25+
-
26+
name: Set up QEMU
27+
uses: docker/setup-qemu-action@v1
28+
-
29+
name: Set up Docker Buildx
30+
uses: docker/setup-buildx-action@v1
31+
-
32+
name: Login to DockerHub
33+
uses: docker/login-action@v1
34+
with:
35+
username: ${{ secrets.DOCKERHUB_USERNAME }}
36+
password: ${{ secrets.DOCKERHUB_TOKEN }}
37+
-
38+
name: Generate App Version
39+
run: echo APP_VERSION=`git describe --tags --always` >> $GITHUB_ENV
40+
-
41+
name: Build and push
42+
uses: docker/build-push-action@v2
43+
with:
44+
context: .
45+
platforms: |
46+
linux/386
47+
linux/amd64
48+
linux/arm64
49+
push: true
50+
build-args: |
51+
APP_NAME=${{ env.APP_NAME }}
52+
APP_VERSION=${{ env.APP_VERSION }}
53+
tags: |
54+
${{ env.DOCKERHUB_REPO }}:latest
55+
${{ env.DOCKERHUB_REPO }}:${{ env.APP_VERSION }}

0 commit comments

Comments
 (0)