Skip to content

format Cargo.toml file #6

format Cargo.toml file

format Cargo.toml file #6

Workflow file for this run

name: Build & Deploy
on:
push:
branches:
- develop
- pipelines-and-dockerfiles
env:
DEFAULT_TAGS: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,format=long,event=branch
IMAGE_BASE_NAME: us.gcr.io/${{ secrets.GCP_PROJECT_ID }}
jobs:
build:
name: Build docker images
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get docker image meta (leader)
id: leader-meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_BASE_NAME }}/zero-bin-leader
tags: ${{ env.DEFAULT_TAGS }}
- name: Get docker image meta (worker)
id: worker-meta
uses: docker/metadata-action@v5
with:
images: ${{ env.IMAGE_BASE_NAME }}/zero-bin-worker
tags: ${{ env.DEFAULT_TAGS }}
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_ID }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
token_format: 'access_token'
access_token_lifetime: '900s'
- name: Login to GCR
uses: docker/login-action@v3
with:
registry: us.gcr.io
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Build and push worker
uses: docker/build-push-action@v5
with:
context: .
file: worker.Dockerfile
push: true
tags: ${{ steps.worker-meta.outputs.tags }}
labels: ${{ steps.worker-meta.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
- name: Build and push leader
uses: docker/build-push-action@v5
with:
context: .
file: coordinator.Dockerfile
push: true
tags: ${{ steps.leader-meta.outputs.tags }}
labels: ${{ steps.leader-meta.outputs.labels }}
# cache-from: type=gha
# cache-to: type=gha,mode=max
deploy:
name: Deploy to GKE
runs-on: ubuntu-latest
needs: build
permissions:
contents: 'read'
id-token: 'write'
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
workload_identity_provider: ${{ secrets.GCP_WORKLOAD_IDENTITY_ID }}
service_account: ${{ secrets.GCP_SERVICE_ACCOUNT }}
- name: Get GKE credentials
id: 'get-credentials'
uses: 'google-github-actions/get-gke-credentials@v2'
with:
cluster_name: 'immutable-prod'
location: 'us-central1'
- name: Install helm
uses: azure/[email protected]
with:
version: 3.14.3
id: install
- name: Deploy to GKE
id: deploy
run: |-
pwd && ls -lh
cd ./deploy/helm
helm upgrade zero-bin ./zero-bin -f ./zero-bin/values.yaml --set hull.config.specific.version=sha-${GITHUB_SHA} -n zkevm --install