Skip to content

Commit 55769e0

Browse files
authored
Update build-push-deploy-promrated.yaml (#3437)
1 parent 272adff commit 55769e0

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

.github/workflows/build-push-deploy-promrated.yaml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
name: Build and Deploy Promrated Image
2+
13
on:
24
push:
35
branches:
46
- main
57
paths:
68
- testutil/promrated/*
79

8-
name: Build and Deply Promrated Image
910
jobs:
1011
build-docker:
1112
runs-on: ubuntu-latest
@@ -14,21 +15,28 @@ jobs:
1415
- uses: actions/checkout@v4
1516
- name: Set up QEMU
1617
id: qemu
17-
uses: docker/setup-qemu-action@v1
18-
- uses: docker/setup-buildx-action@v1
18+
uses: docker/setup-qemu-action@v3
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v3
21+
- name: Cache Docker layers
22+
uses: actions/cache@v3
23+
with:
24+
path: /tmp/.buildx-cache
25+
key: ${{ runner.os }}-buildx-${{ github.sha }}
26+
restore-keys: |
27+
${{ runner.os }}-buildx-
1928
2029
- name: Define docker image meta data tags
2130
id: meta
22-
uses: docker/metadata-action@v3
31+
uses: docker/metadata-action@v5
2332
with:
2433
images: |
2534
obolnetwork/promrated
2635
ghcr.io/obolnetwork/promrated
2736
tags: |
28-
# Tag "git short sha" on all git events
2937
type=sha,prefix=
30-
# Tag "latest" on all git events
3138
type=raw,value=latest
39+
3240
- name: Login to Github container registry
3341
uses: docker/login-action@v2
3442
with:
@@ -42,26 +50,31 @@ jobs:
4250
username: obolnetwork
4351
password: ${{ secrets.DOCKERHUB_TOKEN }}
4452

45-
- uses: docker/build-push-action@v4
53+
- uses: docker/build-push-action@v5
4654
with:
4755
context: .
4856
file: ./testutil/promrated/Dockerfile
4957
platforms: linux/amd64,linux/arm64
5058
push: true
5159
build-args: GITHUB_SHA=${{ github.sha }}
5260
tags: ${{ steps.meta.outputs.tags }}
61+
cache-from: type=local,src=/tmp/.buildx-cache
62+
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
63+
64+
- name: Move cache
65+
run: |
66+
rm -rf /tmp/.buildx-cache
67+
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
5368
5469
- name: Set short git commit SHA
5570
id: vars
56-
run: |
57-
calculatedSha=$(git rev-parse --short=7 ${{ github.sha }})
58-
echo "::set-output name=short_sha::$calculatedSha"
71+
run: echo "short_sha=$(git rev-parse --short=7 ${{ github.sha }})" >> $GITHUB_OUTPUT
5972

6073
- name: Confirm git commit SHA output
6174
run: echo ${{ steps.vars.outputs.short_sha }}
6275

6376
- name: Trigger promrated deploy job
64-
uses: peter-evans/repository-dispatch@v2
77+
uses: peter-evans/repository-dispatch@v3
6578
with:
6679
token: ${{ secrets.CHARON_K8S_REPO_ACCESS_TOKEN }}
6780
repository: ObolNetwork/obol-infrastructure

0 commit comments

Comments
 (0)