Skip to content

Commit

Permalink
Update build-push-deploy-promrated.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
DeVikingMark authored Dec 30, 2024
1 parent 68c224c commit d21ff8b
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions .github/workflows/build-push-deploy-promrated.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,42 @@
name: Build and Deploy Promrated Image

on:
push:
branches:
- main
paths:
- testutil/promrated/*

name: Build and Deply Promrated Image
jobs:
build-docker:
runs-on: ubuntu-latest
name: Build Docker Image
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
- uses: docker/setup-buildx-action@v1
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Define docker image meta data tags
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v5
with:
images: |
obolnetwork/promrated
ghcr.io/obolnetwork/promrated
tags: |
# Tag "git short sha" on all git events
type=sha,prefix=
# Tag "latest" on all git events
type=raw,value=latest
- name: Login to Github container registry
uses: docker/login-action@v2
with:
Expand All @@ -42,26 +50,31 @@ jobs:
username: obolnetwork
password: ${{ secrets.DOCKERHUB_TOKEN }}

- uses: docker/build-push-action@v4
- uses: docker/build-push-action@v5
with:
context: .
file: ./testutil/promrated/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
build-args: GITHUB_SHA=${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max

- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short=7 ${{ github.sha }})
echo "::set-output name=short_sha::$calculatedSha"
run: echo "short_sha=$(git rev-parse --short=7 ${{ github.sha }})" >> $GITHUB_OUTPUT

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

- name: Trigger promrated deploy job
uses: peter-evans/repository-dispatch@v2
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.CHARON_K8S_REPO_ACCESS_TOKEN }}
repository: ObolNetwork/obol-infrastructure
Expand Down

0 comments on commit d21ff8b

Please sign in to comment.