File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build and Push
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - master
7
+
8
+ jobs :
9
+ build :
10
+ strategy :
11
+ fail-fast : false
12
+ matrix :
13
+ target :
14
+ - name : with rootfs
15
+ image-name : menci/syzoj-judge
16
+ dockerfile : Dockerfile
17
+ - name : without rootfs
18
+ image-name : menci/syzoj-judge-norootfs
19
+ dockerfile : Dockerfile.NOROOTFS
20
+ name : Build and Push (${{ matrix.target.name }})
21
+ runs-on : ubuntu-latest
22
+ steps :
23
+ - name : Checkout
24
+ uses : actions/checkout@v2
25
+ - name : Set up QEMU
26
+ uses : docker/setup-buildx-action@v1
27
+ - name : Login to DockerHub
28
+ uses : docker/login-action@v1
29
+ with :
30
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
31
+ password : ${{ secrets.DOCKERHUB_TOKEN }}
32
+ - name : Generate Tag List
33
+ run : |
34
+ echo "TAGS<<EOF" >> $GITHUB_ENV
35
+
36
+ HASH_SHORT="$(git rev-parse --short HEAD)"
37
+ echo $IMAGE_NAME:$HASH_SHORT >> $GITHUB_ENV
38
+ echo $IMAGE_NAME:latest >> $GITHUB_ENV
39
+
40
+ echo "EOF" >> $GITHUB_ENV
41
+ env :
42
+ IMAGE_NAME : ${{ matrix.target.image-name }}
43
+ - name : Build and Push
44
+ uses : docker/build-push-action@v2
45
+ with :
46
+ platforms : linux/amd64
47
+ push : true
48
+ tags : ${{ env.TAGS }}
49
+ file : ${{ matrix.target.dockerfile }}
You can’t perform that action at this time.
0 commit comments