Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

GCP registry #15

Merged
merged 2 commits into from
Jul 8, 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
35 changes: 23 additions & 12 deletions .github/workflows/build-bd-ui-staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,27 @@ jobs:
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master
- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::529724559987:role/gh-action-cicd
role-session-name: bd-ui-staging-build
workload_identity_provider: 'projects/184173984234/locations/global/workloadIdentityPools/oidc-github-identity-pool/providers/oidc-github-provider'
service_account: 'oidc-github-access@lavanet-staging.iam.gserviceaccount.com'

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: 'Set up GCP CLI'
uses: 'google-github-actions/setup-gcloud@v1'

- name: 'GCP CLI Info'
run: |
gcloud info
gcloud auth list --filter=status:ACTIVE --format="value(account)"

- name: 'GCP set project'
run: |
gcloud config set project lavanet-staging

- name: 'Authenticate to Google Artifact'
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev,europe-west4-docker.pkg.dev

- name: Set up NOW environment variable
id: "env-now"
Expand All @@ -53,14 +64,14 @@ jobs:

- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REGISTRY: "us-central1-docker.pkg.dev/lavanet-staging/growth-staging-us-central1/bd-ui-staging"
IMAGE_TAG: ${{ github.sha }}
NOW: ${{ env.NOW }}
run: |
docker buildx build \
-t $REGISTRY/bd-ui:$IMAGE_TAG \
-t $REGISTRY/bd-ui:latest \
-t $REGISTRY/bd-ui:$IMAGE_TAG-$NOW \
-t $REGISTRY:$IMAGE_TAG \
-t $REGISTRY:latest \
-t $REGISTRY:$IMAGE_TAG-$NOW \
--build-arg NEXT_PUBLIC_GRAPHQL_URL=https://bd-graphql.${{ secrets.STAGING_DOMAIN }}/v1/graphql \
--build-arg NEXT_PUBLIC_GRAPHQL_WS=wss://bd-graphql.${{ secrets.STAGING_DOMAIN }}/v1/graphql \
--build-arg NODE_ENV=production \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is a basic workflow to help you get started with Actions
name: Build Big Dipper UI (Zarak)
name: Build Big Dipper UI (Testnet)

# Controls when the workflow will run
on:
Expand All @@ -23,16 +23,27 @@ jobs:
with:
fetch-depth: 0

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@master
- name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
with:
aws-region: us-east-1
role-to-assume: arn:aws:iam::529724559987:role/gh-action-cicd
role-session-name: bd-ui-zarak-build
workload_identity_provider: 'projects/813817494934/locations/global/workloadIdentityPools/oidc-github-identity-pool/providers/oidc-github-provider'
service_account: 'oidc-github-access@lavanet-testnet.iam.gserviceaccount.com'

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: 'Set up GCP CLI'
uses: 'google-github-actions/setup-gcloud@v1'

- name: 'GCP CLI Info'
run: |
gcloud info
gcloud auth list --filter=status:ACTIVE --format="value(account)"

- name: 'GCP set project'
run: |
gcloud config set project lavanet-testnet

- name: 'Authenticate to Google Artifact'
run: |
gcloud auth configure-docker us-central1-docker.pkg.dev,europe-west4-docker.pkg.dev

- name: Set up NOW environment variable
id: "env-now"
Expand All @@ -52,14 +63,14 @@ jobs:

- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REGISTRY: "us-central1-docker.pkg.dev/lavanet-testnet/growth-testnet-us-central1/bd-ui-testnet"
IMAGE_TAG: ${{ github.sha }}
NOW: ${{ env.NOW }}
run: |
docker buildx build \
-t $REGISTRY/bd-ui-zarak:$IMAGE_TAG \
-t $REGISTRY/bd-ui-zarak:$IMAGE_TAG-$NOW \
-t $REGISTRY/bd-ui-zarak:latest \
-t $REGISTRY:$IMAGE_TAG \
-t $REGISTRY:$IMAGE_TAG-$NOW \
-t $REGISTRY:latest \
--build-arg NEXT_PUBLIC_GRAPHQL_URL=https://bd-graphql.lavanet.xyz/v1/graphql \
--build-arg NEXT_PUBLIC_GRAPHQL_WS=wss://bd-graphql.lavanet.xyz/v1/graphql \
--build-arg NODE_ENV=production \
Expand Down
Loading