-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e450f9
commit 37655a0
Showing
1 changed file
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: build-and-deployment | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
# - main | ||
|
||
jobs: | ||
deploy-staging: | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/develop' | ||
steps: | ||
- uses: 'actions/checkout@v3' | ||
- run: ls | ||
- id: 'auth' | ||
name: 'Authenticate to Google Cloud' | ||
uses: 'google-github-actions/auth@v1' | ||
with: | ||
credentials_json: '${{ secrets.GCP_CREDENTIALS }}' | ||
|
||
- name: Debug GCP credentials | ||
env: | ||
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} | ||
run: | | ||
echo "$GOOGLE_APPLICATION_CREDENTIALS" > credentials.json | ||
- name: 'Set up Cloud SDK' | ||
uses: 'google-github-actions/setup-gcloud@v1' | ||
with: | ||
version: '>= 363.0.0' | ||
- name: 'Use gcloud CLI' | ||
run: 'gcloud info' | ||
- name: Install Python dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- name: 'Deploy a gen 2 cloud function' | ||
run: | | ||
gcloud functions deploy whatsapp-webhook-analytics-staging \ | ||
--gen2 \ | ||
--runtime=python312 \ | ||
--region=asia-south1 \ | ||
--trigger-http \ | ||
--entry-point=handle_payload \ | ||
--memory=256MB \ | ||
--timeout=30s \ | ||
--set-env-vars=FLASK_APP=${{ secrets.FLASK_APP_STAGING }},DB_USER=${{ secrets.DB_USER }},DB_PASSWORD=${{ secrets.DB_PASSWORD }},DB_NAME=${{ secrets.DB_NAME }},DB_PORT=${{ secrets.DB_PORT }},CONNECTION_NAME=${{ secrets.CONNECTION_NAME }},LOGGING_LEVEL=${{ secrets.LOGGING_LEVEL }} | ||
# deploy-production: | ||
# runs-on: ubuntu-latest | ||
# if: github.ref == 'refs/heads/main' | ||
# steps: | ||
# - uses: 'actions/checkout@v3' | ||
# - run: ls | ||
# - id: 'auth' | ||
# name: 'Authenticate to Google Cloud' | ||
# uses: 'google-github-actions/auth@v1' | ||
# with: | ||
# credentials_json: '${{ secrets.GCP_CREDENTIALS }}' | ||
|
||
# - name: Debug GCP credentials | ||
# env: | ||
# GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCP_CREDENTIALS }} | ||
# run: | | ||
# echo "$GOOGLE_APPLICATION_CREDENTIALS" > credentials.json | ||
|
||
# - name: 'Set up Cloud SDK' | ||
# uses: 'google-github-actions/setup-gcloud@v1' | ||
# with: | ||
# version: '>= 363.0.0' | ||
# - name: 'Use gcloud CLI' | ||
# run: 'gcloud info' | ||
# - name: Install Python dependencies | ||
# run: | | ||
# pip install -r requirements.txt | ||
# - name: 'Deploy a gen 2 cloud function' | ||
# run: | | ||
# gcloud functions deploy admindashboard-webhook-queue-service-prod \ | ||
# --gen2 \ | ||
# --runtime=python312 \ | ||
# --region=asia-south1 \ | ||
# --trigger-http \ | ||
# --entry-point=handle_payload \ | ||
# --memory=256MB \ | ||
# --timeout=30s \ | ||
# --set-env-vars=FLASK_APP=${{ secrets.FLASK_APP_STAGING }},DB_USER=${{ secrets.DB_USER }},DB_PASSWORD=${{ secrets.DB_PASSWORD }},DB_NAME=${{ secrets.DB_NAME }},DB_PORT=${{ secrets.DB_PORT }},CONNECTION_NAME=${{ secrets.CONNECTION_NAME }},LOGGING_LEVEL=${{ secrets.LOGGING_LEVEL }} |