-
Notifications
You must be signed in to change notification settings - Fork 2
123 lines (119 loc) · 4.79 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
---
# This workflow will build a docker image and deploy it to trustwallet stating \
# and production environments
# yamllint disable rule:line-length
name: Version_Release
on:
push:
tags:
- v0.**
jobs:
js_build_test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [21.x]
# node-version: [14.x, 16.x, 18.x, 20.x]
# See supported Node.js release schedule at
# https://nodejs.org/en/about/releases/
steps:
- name: checkout repo
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Yarn install, build and test
run: echo "In the steps below we will build and run first set of tests for all components"
- run: echo yarn install
- run: echo yarn lint
- run: echo yarn build
- run: echo yarn test
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Dump GITHUB_REF
run: echo "${GITHUB_REF}"
container_img_build_push_gar:
needs: [js_build_test]
# Allow the job to fetch a GitHub ID token
permissions:
id-token: write
contents: read
# The plan is to build and push each docker image in parallel.
strategy:
matrix:
image:
- us-docker.pkg.dev/biconomy-prod/bundler/trustwallet
- us-docker.pkg.dev/prj-biconomy-prod-001/bundler/bundler
# LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE
# {owner}/{repo}/.github/workflows/{filename}@{ref}
uses: bcnmy/bundler/.github/workflows/container_img_build_push_gar.yaml@master
with:
image: ${{ matrix.image }}
dockerfile: Dockerfile.helm
# GCP project where the identity provider is
# gcloud projects describe prj-workload-identity-001
gcp_project_number: '766873424314'
gcp_pool_id: 'pool-id-github-actions'
# gcp_provider_id: 'ga-GITHUB_REPO_NAME'
gcp_provider_id: 'ga-bundler'
# LOCATION-docker.pkg.dev/PROJECT-ID/REPOSITORY/IMAGE
gcp_registry: 'us-docker.pkg.dev/biconomy-prod/bundler/trustwallet'
gcp_service_account: 'sa-bundler@prj-workload-identity-001.iam.gserviceaccount.com'
deploy_tw_staging:
needs: [container_img_build_push_gar]
# Allow the job to fetch a GitHub ID token
# runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
uses: bcnmy/bundler/.github/workflows/deploy_to_gke.yaml@master
with:
# GCP project where the identity provider is
# gcloud projects describe prj-workload-identity-001
gcp_project_number: '766873424314'
gcp_project_id: 'biconomy-prod'
gcp_bastion: 'bastion02'
gcp_bastion_zone: 'us-east1-b'
gcp_pool_id: 'pool-id-github-actions'
# gcp_provider_id: 'ga-GITHUB_REPO_NAME'
gcp_provider_id: 'ga-bundler'
# SERVICE_ACCOUNT_EMAIL="${SERVICE_ACCOUNT}@${PROJECT}.iam.gserviceaccount.com"
gcp_service_account: 'sa-bundler@prj-workload-identity-001.iam.gserviceaccount.com'
gcp_cluster_name: 'dedicated-bundler'
gcp_cluster_location: 'us-east1'
use_internal_ip: true
# https://docs.github.com/en/actions/learn-github-actions/variables#default-environment-variables
# deploy_command: 'helm ls --all-namespaces'
# deploy_command: 'echo IMG_VERSION is ${GITHUB_REF:10}' # for example extracts v0.0.5 from "refs/tags/v0.0.5"
deploy_command: './install-bundler/bundler-update-release.sh bundler-tw-staging.cfg ${GITHUB_REF:10}'
deploy_tw_prod:
needs: [deploy_tw_staging]
# environment: tw-prod
# Allow the job to fetch a GitHub ID token
# runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
uses: bcnmy/bundler/.github/workflows/deploy_to_gke.yaml@master
with:
environment: 'tw-prod'
# GCP project where the identity provider is
# gcloud projects describe prj-workload-identity-001
gcp_project_number: '766873424314'
# GCP project ID where the workload will be deployed
gcp_project_id: 'prj-biconomy-prod-001'
gcp_bastion: 'bastion02'
gcp_bastion_zone: 'us-central1-a'
gcp_pool_id: 'pool-id-github-actions'
# gcp_provider_id: 'ga-GITHUB_REPO_NAME'
gcp_provider_id: 'ga-bundler'
# SERVICE_ACCOUNT_EMAIL="${SERVICE_ACCOUNT}@${PROJECT}.iam.gserviceaccount.com"
gcp_service_account: 'sa-bundler@prj-workload-identity-001.iam.gserviceaccount.com'
gcp_cluster_name: 'trustwallet'
gcp_cluster_location: 'us-central1'
use_internal_ip: true
deploy_command: './install-bundler/bundler-update-release.sh bundler-tw-production.cfg ${GITHUB_REF:10}'
# deploy_command: 'helm ls --all-namespaces'