diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yaml similarity index 91% rename from .github/workflows/build_and_publish.yml rename to .github/workflows/build_and_publish.yaml index b118d50..6a3ac04 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yaml @@ -28,7 +28,7 @@ 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 @@ -36,11 +36,11 @@ jobs: 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/build-push-action@v2.7.0 diff --git a/.github/workflows/build_and_publish_tee.yaml b/.github/workflows/build_and_publish_tee.yaml new file mode 100644 index 0000000..57170ff --- /dev/null +++ b/.github/workflows/build_and_publish_tee.yaml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yaml similarity index 100% rename from .github/workflows/ci.yml rename to .github/workflows/ci.yaml diff --git a/.github/workflows/ci_sgx.yaml b/.github/workflows/ci_sgx.yaml new file mode 100644 index 0000000..6884b2b --- /dev/null +++ b/.github/workflows/ci_sgx.yaml @@ -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