Skip to content

Commit 245be4d

Browse files
committed
chore: fix cache + don't build if image exist
1 parent 83465e1 commit 245be4d

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/docker.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@ jobs:
1313
matrix:
1414
chain:
1515
# TODO: make it dynamic
16+
- axone
1617
- juno
1718
- nolus
1819
- govgen
1920

2021
runs-on: ubuntu-latest
2122
steps:
2223
- name: Checkout
23-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Go
27+
uses: actions/setup-go@v5
2428

2529
# TODO: first check if docker image not already exist
2630

@@ -86,11 +90,21 @@ jobs:
8690
type=raw,value=latest
8791
type=raw,value=${{ steps.version.outputs.result }}
8892
93+
- name: Check if image already exist
94+
id: image_exists
95+
continue-on-error: true
96+
uses: cloudposse/[email protected]
97+
with:
98+
image_name: "${{ github.repository }}/${{ matrix.chain }}"
99+
registry: ghcr.io
100+
tag: "${{ steps.version.outputs.result }}"
101+
89102
# TODO: Check if the directory have a custom Dockerfile
90103
# in that case, build a different image
91104

92105
- name: Build and push
93106
uses: docker/build-push-action@v3
107+
if: "steps.image_exists.outcome == 'failure'"
94108
with:
95109
file: "./Dockerfile"
96110
context: ./${{ matrix.chain }}

0 commit comments

Comments
 (0)