File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ name : DockerHub
2+
3+ on :
4+ workflow_dispatch :
5+ schedule :
6+ - cron : ' 0 0 * * 1'
7+ push :
8+ branches :
9+ - master
10+ tags :
11+ - ' *.*.*'
12+ paths :
13+ - ' .dockerignore'
14+ - ' .github/workflows/dockerhub.yml'
15+ - ' Dockerfile'
16+ - ' go.mod'
17+ - ' go.sum'
18+ - ' **.go'
19+
20+ jobs :
21+ multiarch-build :
22+ runs-on : ubuntu-latest
23+ steps :
24+
25+ - name : Checkout
26+ uses : actions/checkout@v2
27+ with :
28+ fetch-depth : 0
29+
30+ - name : Get Docker tags
31+ id : docker_meta
32+ uses : crazy-max/ghaction-docker-meta@v2
33+ with :
34+ images : jwilder/docker-gen
35+ tags : |
36+ type=semver,pattern={{version}}
37+ type=semver,pattern={{major}}.{{minor}}
38+ type=raw,value=latest,enable=${{ endsWith(github.ref, github.event.repository.default_branch) }}
39+
40+ - name : Set up QEMU
41+ uses : docker/setup-qemu-action@v1
42+
43+ - name : Set up Docker Buildx
44+ uses : docker/setup-buildx-action@v1
45+
46+ - name : Login to DockerHub
47+ uses : docker/login-action@v1
48+ with :
49+ username : ${{ secrets.DOCKERHUB_USERNAME }}
50+ password : ${{ secrets.DOCKERHUB_TOKEN }}
51+
52+ - name : Build and push
53+ id : docker_build
54+ uses : docker/build-push-action@v2
55+ with :
56+ platforms : linux/amd64,linux/arm64,linux/arm/v7
57+ push : true
58+ tags : ${{ steps.docker_meta.outputs.tags }}
59+ labels : ${{ steps.docker_meta.outputs.labels }}
60+
61+ - name : Image digest
62+ run : echo ${{ steps.docker_build.outputs.digest }}
You can’t perform that action at this time.
0 commit comments