Skip to content

Push server to GCP

Push server to GCP #12

Workflow file for this run

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
id: auth
uses: google-github-actions/auth@v2
with:
token_format: 'access_token'
project_id: ${{ secrets.GCP_PROJECT_ID }}
workload_identity_provider: '${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}'
service_account: '${{ secrets.SERVICE_ACCOUNT }}'
- name: Docker Auth
id: docker-auth
uses: 'docker/login-action@v1'
with:
username: 'oauth2accesstoken'
password: '${{ steps.auth.outputs.access_token }}'
registry: ${{ env.DOCKER_REGISTRY }}
- name: Push proposr to GCP
run: |
gcloud auth configure-docker ${{ env.DOCKER_REGISTRY }}
docker build . -f proposer/op/Dockerfile.op_proposer -t ${{ env.DOCKER_REGISTRY }}/${{ secrets.GCP_REPO }}/op-succinct-proposer:${{ github.ref_name }}
docker push ${{ env.DOCKER_REGISTRY }}/${{ secrets.GCP_REPO }}/op-succinct-proposer:${{ github.ref_name }}
- name: Push server to GCP
run: |
docker build . -f proposer/succinct/Dockerfile -t ${{ env.DOCKER_REGISTRY }}/${{ secrets.GCP_REPO }}/op-succinct-server:${{ github.ref_name }}
docker push ${{ env.DOCKER_REGISTRY }}/${{ secrets.GCP_REPO }}/op-succinct-server:${{ github.ref_name }}