Skip to content

Commit

Permalink
chore: build flux build ID for tags
Browse files Browse the repository at this point in the history
Signed-off-by: Harald Hoyer <[email protected]>
  • Loading branch information
haraldh committed Jun 26, 2024
1 parent 723f759 commit 2cd51db
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build_and_publish_tee.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- "gramine*"
tags:
- "*-sgx"
workflow_dispatch:
inputs:
target_branch:
Expand Down Expand Up @@ -71,11 +73,18 @@ jobs:
- name: Generate build ID for Flux Image Automation
id: flux
if: ${{ !startsWith(github.ref, 'refs/tags') }}
run: |
sha=$(git rev-parse --short HEAD)
ts=$(date +%s%N | cut -b1-13)
echo "BUILD_ID=${sha}-${ts}" >> "$GITHUB_OUTPUT"
- name: Generate build ID for Flux Image Automation
id: tag
if: ${{ startsWith(github.ref, 'refs/tags') }}
run: |
echo "BUILD_ID=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
- name: Auth to google artifact registry
run: |
gcloud auth configure-docker us-docker.pkg.dev -q
Expand All @@ -87,3 +96,11 @@ jobs:
docker push "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:latest"
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:${{ steps.flux.outputs.BUILD_ID }}"
docker push "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:${{ steps.flux.outputs.BUILD_ID }}"
- name: Push Docker image to matterlabs-infra
if: ${{ startsWith(github.ref, 'refs/tags') }}
run: |
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:latest"
docker push "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:latest"
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:${{ steps.tag.outputs.BUILD_ID }}"
docker push "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:${{ steps.tag.outputs.BUILD_ID }}"

0 comments on commit 2cd51db

Please sign in to comment.