-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): Build and push docker images for TEE branches (#18)
# 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
Showing
4 changed files
with
90 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |