Skip to content

Commit

Permalink
Deploy prod
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-dharti-r committed Apr 22, 2024
1 parent 944c53a commit b369fa9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-backend-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: DeployBackendDev
on:
push:
branches:
- "implement-get-apis-for-post"
- "master"

jobs:
deploy-backend-dev:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/deploy-backend-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: DeployBackendProd
on:
push:
branches:
- "master"
- "implement-get-apis-for-post"

jobs:
deploy-backend-prod:
Expand All @@ -27,7 +27,8 @@ jobs:

- name: Build backend and copy zip to S3
run: |
sed -i "s/RECAPTCHA_CONFIG_JSON_BASE64/${{ secrets.RECAPTCHA_CONFIG_JSON_BASE64 }}/g" utils/helper.go
secret_value="${{ secrets.RECAPTCHA_CONFIG_JSON_BASE64 }}"
awk -v val="${secret_value}" '{gsub(/{{RECAPTCHA_CONFIG_JSON_BASE64}}/, val)} 1' utils/helper.go > temp.go && mv temp.go utils/helper.go
apt-get update && apt-get install -y zip
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main main.go
zip canopas_serverless_prod_${{ github.sha }}.zip main
Expand Down Expand Up @@ -56,6 +57,7 @@ jobs:
DbHost=${{ secrets.DB_HOST }},
DbPort=${{ secrets.DB_PORT }},
DbName=${{ secrets.DB_NAME }},
BlogDbName=${{ secrets.BLOG_DB_NAME }},
RecaptchaSiteKey=${{ secrets.RECAPTCHA_SITE_KEY }},
RecaptchaProjectId=${{ secrets.RECAPTCHA_PROJECT_ID }},
JobsSpreadsheetId=${{ secrets.JOBS_SPREADSHEET_ID }},
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/deploy-frontend-dev.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: DeployFrontendServerlessDev

on:
push:
workflow_run:
workflows: ["DeployBackendDev"]
types:
- completed
branches:
- "implement-get-apis-for-post"
- "master"

jobs:
deploy-frontend-dev:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/deploy-frontend-prod.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
name: DeployFrontendServerlessProd

on:
workflow_run:
workflows: ["DeployBackendProd"]
types:
- completed
push:
branches:
- "master"
- "implement-get-apis-for-post"

jobs:
deploy-frontend-prod:
Expand Down
2 changes: 1 addition & 1 deletion utils/spreadsheet.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (repo *utilsRepository) SaveJobsToSpreadSheet(records []string) {
}

func googleServiceAuth(ctx context.Context, scope string, sheet bool) interface{} {
credBytes, err := b64.StdEncoding.DecodeString(os.Getenv("RECAPTCHA_CONFIG_JSON_BASE64"))
credBytes, err := b64.StdEncoding.DecodeString(recaptchaBase64)
if err != nil {
log.Error(err)
return nil
Expand Down

0 comments on commit b369fa9

Please sign in to comment.