mirror of
https://github.com/matter-labs/teepot.git
synced 2025-07-21 15:13:56 +02:00
chore: Update GitHub actions to run on custom runner and push to Google Artifact Registry
This commit updates the GitHub workflows to push Docker images to Google Artifact Registry. Additionally, it refines event conditions, separates build ID generation for normal pushes and tag pushes, and introduces tagging workflow for '*-sgx-*' tags. Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
parent
8329eb8b96
commit
695355d095
1 changed files with 25 additions and 7 deletions
32
.github/workflows/nix.yml
vendored
32
.github/workflows/nix.yml
vendored
|
@ -5,6 +5,7 @@ on:
|
|||
branches: [ "main" ]
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
tags: [ "*-sgx-*" ]
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
|
@ -102,21 +103,38 @@ jobs:
|
|||
docker push matterlabsrobot/"${{ steps.build.outputs.IMAGE_TAG }}"
|
||||
|
||||
- name: Tag container as latest
|
||||
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: |
|
||||
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" matterlabsrobot/"${{ steps.build.outputs.IMAGE_NAME }}:latest"
|
||||
docker push matterlabsrobot/"${{ steps.build.outputs.IMAGE_NAME }}:latest"
|
||||
|
||||
- name: Generate build ID for Flux Image Automation
|
||||
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
|
||||
id: buildid
|
||||
id: flux
|
||||
if: ${{ github.event_name == 'push' && !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: Push Docker image to matterlabs-infra
|
||||
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
|
||||
- name: Generate build ID for Flux Image Automation
|
||||
id: tag
|
||||
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
|
||||
run: |
|
||||
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" matterlabsrobot/"${{ steps.build.outputs.IMAGE_NAME }}:${{ steps.buildid.outputs.BUILD_ID }}"
|
||||
docker push matterlabsrobot/"${{ steps.build.outputs.IMAGE_NAME }}:${{ steps.buildid.outputs.BUILD_ID }}"
|
||||
echo "BUILD_ID=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Auth to google artifact registry
|
||||
if: ${{ github.event_name == 'push' }}
|
||||
run: |
|
||||
gcloud auth configure-docker us-docker.pkg.dev -q
|
||||
|
||||
- name: Push Docker image to matterlabs-infra
|
||||
if: ${{ github.event_name == 'push' && !startsWith(github.ref, 'refs/tags') }}
|
||||
run: |
|
||||
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ steps.build.outputs.IMAGE_NAME }}:${{ steps.flux.outputs.BUILD_ID }}"
|
||||
docker push "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ steps.build.outputs.IMAGE_NAME }}:${{ steps.flux.outputs.BUILD_ID }}"
|
||||
|
||||
- name: Push Docker image to matterlabs-infra
|
||||
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }}
|
||||
run: |
|
||||
docker tag "${{ steps.build.outputs.IMAGE_TAG }}" "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ steps.build.outputs.IMAGE_NAME }}:${{ steps.tag.outputs.BUILD_ID }}"
|
||||
docker push "us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/${{ steps.build.outputs.IMAGE_NAME }}:${{ steps.tag.outputs.BUILD_ID }}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue