Skip to content

Commit

Permalink
chore(ci): Build and push docker images for TEE branches (#18)
Browse files Browse the repository at this point in the history
# What ❔

CI for building and pushing TEE images of era-fee-withdrawer

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [x] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.
  • Loading branch information
artmakh authored Dec 12, 2023
1 parent 6c8a1eb commit 97eab6b
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ jobs:
id: tag
if: ${{ startsWith(github.ref, 'refs/tags') }}
run: |
echo "::set-output name=BUILD_ID::${GITHUB_REF#refs/*/}"
echo "name=BUILD_ID::${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT"
- name: Generate build ID for Flux Image Automation
id: build
if: ${{ !startsWith(github.ref, 'refs/tags') }}
run: |
sha=$(git rev-parse --short HEAD)
ts=$(date +%s%N | cut -b1-13)
echo "::set-output name=BUILD_ID::${sha}-${ts}"
echo "name=BUILD_ID::${sha}-${ts}" >> "$GITHUB_OUTPUT"
- name: Auth to google artifact registry
run: |
gcloud auth configure-docker us-docker.pkg.dev -q
gcloud auth configure-docker us-docker.pkg.dev -q
- name: Build and push Docker image
uses: docker/[email protected]
Expand Down
57 changes: 57 additions & 0 deletions .github/workflows/build_and_publish_tee.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and publish fee-withdrawer-v2-tee image

on:
push:
branches:
- "gramine*"
workflow_dispatch:
inputs:
target_branch:
description: "Target branch to build fee-withdrawer-v2-tee image against"
type: string
required: true

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: [matterlabs-ci-runner]

steps:
- uses: actions/checkout@v4
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
ref: ${{ github.event.inputs.target_branch }}

- uses: actions/checkout@v4
if: ${{ github.event_name != 'workflow_dispatch' }}

- name: Set up Docker Buildx
uses: docker/setup-qemu-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Generate build ID for Flux Image Automation
id: build
run: |
sha=$(git rev-parse --short HEAD)
ts=$(date +%s%N | cut -b1-13)
echo "name=BUILD_ID::${sha}-${ts}" >> "$GITHUB_OUTPUT"
- name: Auth to google artifact registry
run: |
gcloud auth configure-docker us-docker.pkg.dev -q
- name: Build and push Docker image
uses: docker/build-push-action@v5
if: ${{ !startsWith(github.ref, 'refs/tags') }}
with:
push: true
tags: |
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:latest"
"us-docker.pkg.dev/matterlabs-infra/matterlabs-docker/fee-withdrawer-v2-tee:${{ steps.build.outputs.BUILD_ID }}"
file: Dockerfile
no-cache: true
File renamed without changes.
30 changes: 30 additions & 0 deletions .github/workflows/ci_sgx.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: CI

on:
pull_request:
branches:
- "gramine*"

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: install dependencies
run: yarn

- name: running tests
run: yarn test

- name: test Docker image build
uses: docker/build-push-action@v5
with:
push: false
file: Dockerfile
no-cache: true

0 comments on commit 97eab6b

Please sign in to comment.