Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): Build and push docker images for TEE branches #18

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading