Skip to content

Commit 18d419a

Browse files
authored
Merge pull request #112 from madflojo/docker-build
chore(ci): fixing the docker build i broke
2 parents d9c985d + 2ba2545 commit 18d419a

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/docker.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,20 @@ on:
55
- main
66
tags:
77
- v*
8+
pull_request:
9+
branches:
10+
- main
811
jobs:
9-
build-latest:
12+
docker-build:
1013
runs-on: ubuntu-latest
1114
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
1222
- name: Set up QEMU
1323
uses: docker/setup-qemu-action@v1
1424
- name: Set up Docker Buildx
@@ -24,20 +34,15 @@ jobs:
2434
uses: docker/build-push-action@v2
2535
with:
2636
platforms: linux/amd64,linux/arm64
27-
push: true
37+
push: ${{ if github.event_name == 'push', 'true', 'false' }}
2838
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
3439
- name: Build and push (tag)
3540
id: docker_build_tag
3641
if: startsWith(github.ref, 'refs/tags/v')
3742
uses: docker/build-push-action@v2
3843
with:
3944
platforms: linux/amd64,linux/arm64
40-
push: true
45+
push: ${{ if github.event_name == 'push', 'true', 'false' }}
4146
# tag with the git tag v*
4247
tags: |
4348
madflojo/tarmac:${{ github.ref_name }}

0 commit comments

Comments
 (0)