File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 }}
You can’t perform that action at this time.
0 commit comments