forked from hypersign-protocol/entity-api-service
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (114 loc) · 6.7 KB
/
pipeline.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
124
name: Dashbord Service Build and Deploy Pipeline
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
- "[0-9]+.[0-9]+.[0-9]-rc.[0-9]+"
jobs:
Build-Pipeline:
runs-on: ubuntu-latest
environment: production
steps:
- name: code checkout
uses: actions/checkout@v3
- name: Set Latest Tag
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
- name: install gcloud cli tools
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{secrets.GOOGLE_PROJECT_ID}}
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
install_components: "gke-gcloud-auth-plugin"
export_default_credentials: true
- name: "Use gcloud CLI"
run: "gcloud info"
- name: "Docker Auth"
run: gcloud auth configure-docker ${{secrets.GOOGLE_ARTIFACT_URL}}
- name: "Docker Build and Push"
env:
GOOGLE_PROJECT_ID: ${{secrets.GOOGLE_PROJECT_ID}}
GOOGLE_ARTIFACT_URL: ${{secrets.GOOGLE_ARTIFACT_URL}}
GOOGLE_ARTIFACT_REPO: ${{secrets.GOOGLE_ARTIFACT_REPO}}
run:
docker build -t $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/entity-developer-dashbord-service:${{ env.LATEST_RELEASE_TAG }} .
docker push $GOOGLE_ARTIFACT_URL/$GOOGLE_PROJECT_ID/$GOOGLE_ARTIFACT_REPO/entity-developer-dashbord-service:${{ env.LATEST_RELEASE_TAG }}
Deploy-Pipeline:
needs: [Build-Pipeline]
runs-on: ubuntu-latest
environment: production
steps:
- name: code checkout
uses: actions/checkout@v3
- name: Set Latest Tag
run: echo "LATEST_RELEASE_TAG=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
- id: "auth"
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}"
- name: install gcloud cli tools
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{secrets.GOOGLE_PROJECT_ID}}
service_account_key: ${{secrets.GOOGLE_APPLICATION_CREDENTIALS}}
install_components: "gke-gcloud-auth-plugin"
export_default_credentials: true
- name: "Configure kubectl"
run: gcloud container clusters get-credentials hypermine-gke --region=asia-south1
- name: Replace tags
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__LATEST_RELEASE_TAG__#${{ env.LATEST_RELEASE_TAG }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__PORT__/${{ secrets.PORT }}/g'' {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__DATABASE_CONNECTION_PATH__#${{ secrets.DATABASE_CONNECTION_PATH }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__HID_NETWORK_API__#${{ secrets.HID_NETWORK_API }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__HID_NETWORK_RPC__#${{ secrets.HID_NETWORK_RPC }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__HID_NETWORK_NAMESPACE__/${{ secrets.HID_NETWORK_NAMESPACE }}/g'' {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__EDV_BASE_URL__#${{ secrets.EDV_BASE_URL }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__EDV_CONFIG_DIR__/${{ secrets.EDV_CONFIG_DIR }}/g'' {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__EDV_DID_FILE_PATH__#${{ secrets.EDV_DID_FILE_PATH }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__EDV_KEY_FILE_PATH__#${{ secrets.EDV_KEY_FILE_PATH }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__MNEMONIC__#${{ secrets.MNEMONIC }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__JWT_SECRET__/${{ secrets.JWT_SECRET }}/g'' {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__DEVELOPER_DASHBOARD_SERVICE_PUBLIC_EP__#${{ secrets.DEVELOPER_DASHBOARD_SERVICE_PUBLIC_EP }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__EMAIL_CREDENTITAL_SCHEMA_ID__#${{ secrets.EMAIL_CREDENTITAL_SCHEMA_ID }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__TENANT_SUBDOMAIN_PREFIX__#${{ secrets.TENANT_SUBDOMAIN_PREFIX }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__SSI_API_DOMAIN__#${{ secrets.SSI_API_DOMAIN }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__MFA_ISSUER__#${{ secrets.MFA_ISSUER }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__CAVACH_API_DOMAIN__#${{ secrets.CAVACH_API_DOMAIN }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__VAULT_PREFIX__#${{ secrets.VAULT_PREFIX }}#" {} \;
- name: "Replace Secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i "s#__ENTITY_API_SERVICE_BASE_URL__#${{ secrets.ENTITY_API_SERVICE_BASE_URL }}#" {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_URL__/${{ secrets.GOOGLE_ARTIFACT_URL }}/g'' {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_ARTIFACT_REPO__/${{ secrets.GOOGLE_ARTIFACT_REPO }}/g'' {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_PROJECT_ID__/${{ secrets.GOOGLE_PROJECT_ID }}/g'' {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_CLIENT_ID__/${{ secrets.GOOGLE_CLIENT_ID }}/g'' {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i ''s/__GOOGLE_CLIENT_SECRET__/${{ secrets.GOOGLE_CLIENT_SECRET }}/g'' {} \;
- name: "Replace secrets"
run: find .deploy/deployment.yaml -type f -exec sed -i -e "s#__REDIRECT_URL__#${{ secrets.REDIRECT_URL }}#" {} \;
- name: "Deploy to GKE"
run: kubectl apply -f .deploy/deployment.yaml