File tree 1 file changed +13
-8
lines changed
1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 5
5
- main
6
6
tags :
7
7
- v*
8
+ pull_request :
9
+ branches :
10
+ - main
8
11
jobs :
9
- build-latest :
12
+ docker-build :
10
13
runs-on : ubuntu-latest
11
14
steps :
15
+ - name : Checkout code
16
+ uses : actions/checkout@v2
17
+ - name : Get latest tag
18
+ run : |
19
+ git fetch --tags
20
+ echo "current_tag=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
21
+ echo "latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV
12
22
- name : Set up QEMU
13
23
uses : docker/setup-qemu-action@v1
14
24
- name : Set up Docker Buildx
@@ -24,20 +34,15 @@ jobs:
24
34
uses : docker/build-push-action@v2
25
35
with :
26
36
platforms : linux/amd64,linux/arm64
27
- push : true
37
+ push : ${{ if github.event_name == 'push', ' true', 'false' }}
28
38
tags : madflojo/tarmac:unstable
29
- - name : Checkout code and fetch all tags
30
- run : |
31
- git fetch --tags
32
- echo "current_tag=$(echo ${GITHUB_REF#refs/tags/})" >> $GITHUB_ENV
33
- echo "latest_tag=$(git describe --tags `git rev-list --tags --max-count=1`)" >> $GITHUB_ENV
34
39
- name : Build and push (tag)
35
40
id : docker_build_tag
36
41
if : startsWith(github.ref, 'refs/tags/v')
37
42
uses : docker/build-push-action@v2
38
43
with :
39
44
platforms : linux/amd64,linux/arm64
40
- push : true
45
+ push : ${{ if github.event_name == 'push', ' true', 'false' }}
41
46
# tag with the git tag v*
42
47
tags : |
43
48
madflojo/tarmac:${{ github.ref_name }}
You can’t perform that action at this time.
0 commit comments