From 323d7ef142d597deba5753b419683e99e284d272 Mon Sep 17 00:00:00 2001 From: cby3149 Date: Wed, 16 Oct 2024 13:32:10 -0700 Subject: [PATCH] Add release CI/CD --- .github/workflows/release.yml | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..7751ad1a --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,37 @@ +name: Release to GCP + +on: + push: + tags: + - 'v*.*.*' + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: 'read' + id-token: 'write' + + env: + DOCKER_REGISTRY: us-docker.pkg.dev + + steps: + - uses: 'actions/checkout@v4' + + - name: Authenticate to GCP using Workload Identity Federation + uses: google-github-actions/auth@v2 + with: + workload_identity_provider: '${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}' + service_account: '${{ secrets.SERVICE_ACCOUNT }}' + + - name: Build op-proposer + run: | + cd programs/proposer + cargo build --release + + - name: Push to GCP + run: | + gcloud auth configure-docker $DOCKER_REGISTRY + docker build -f Dockerfile.op_proposer -t $$DOCKER_REGISTRY/${{ secrets.GCP_PROJECT_ID }}/op-succinct-proposer:${{ github.ref_name }} . + docker push $$DOCKER_REGISTRY/${{ secrets.GCP_PROJECT_ID }}/op-succinct-proposer:${{ github.ref_name }} + working-directory: proposer/op \ No newline at end of file