-
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.
Merge pull request #10 from its-kunal/develop
changes for BE CI/CD.
- Loading branch information
Showing
8 changed files
with
106 additions
and
13 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,48 @@ | ||
name: Build and Deploy to Google Cloud Run Production | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- 'server/**' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
build_and_deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
PROJECT_ID: ${{ secrets.PROJECT_ID }} | ||
APP: chatterbox | ||
REGION: asia-south1 | ||
GAR_LOCATION: asia-south1 | ||
steps: | ||
- name: "Checkout Server Code" | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: server | ||
- name: "Google Auth" | ||
uses: "google-github-actions/auth@v2" | ||
with: | ||
workload_identity_provider: "${{ secrets.WIF_PROVIDER }}" | ||
service_account: "${{ secrets.WIF_SERVICE_ACCOUNT }}" | ||
- name: "Set up Cloud SDK" | ||
uses: "google-github-actions/setup-gcloud@v1" | ||
with: | ||
project_id: "${{ secrets.PROJECT_ID }}" | ||
- name: "Docker auth" | ||
run: |- | ||
gcloud auth configure-docker ${{ env.GAR_LOCATION }}-docker.pkg.dev | ||
- name: "Build and push container" | ||
run: |- | ||
docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.APP }}/${{ env.APP }}:production" ./server | ||
docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.APP }}/${{ env.APP }}:production" | ||
- name: "Cloud Run Release" | ||
run : |- | ||
gcloud run services describe my-chat-server --region ${{ env.GAR_LOCATION }} --format export > service.yaml | ||
gcloud run services replace service.yaml | ||
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,47 @@ | ||
name: Build and Deploy to Google Cloud Run | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
paths: | ||
- "server/**" | ||
|
||
permissions: | ||
id-token: write | ||
contents: read | ||
|
||
jobs: | ||
build_and_deploy: | ||
runs-on: ubuntu-latest | ||
env: | ||
PROJECT_ID: ${{ secrets.PROJECT_ID }} | ||
APP: chatterbox | ||
REGION: asia-south1 | ||
GAR_LOCATION: asia-south1 | ||
steps: | ||
- name: "Checkout Server Code" | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: server | ||
- name: "Google Auth" | ||
uses: "google-github-actions/auth@v2" | ||
with: | ||
workload_identity_provider: "${{ secrets.WIF_PROVIDER }}" | ||
service_account: "${{ secrets.WIF_SERVICE_ACCOUNT }}" | ||
- name: "Set up Cloud SDK" | ||
uses: "google-github-actions/setup-gcloud@v1" | ||
with: | ||
project_id: "${{ secrets.PROJECT_ID }}" | ||
- name: "Docker auth" | ||
run: |- | ||
gcloud auth configure-docker ${{ env.GAR_LOCATION }}-docker.pkg.dev | ||
- name: "Build and push container" | ||
run: |- | ||
docker build -t "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.APP }}/${{ env.APP }}:staging" ./server | ||
docker push "${{ env.GAR_LOCATION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.APP }}/${{ env.APP }}:staging" | ||
- name: "Cloud Run Release" | ||
run : |- | ||
gcloud run services describe chatterbox-staging --region ${{ env.GAR_LOCATION }} --format export > service.yaml | ||
gcloud run services replace service.yaml | ||
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
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
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
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
/// <reference types="vite/client" /> | ||
/// <reference types="vite-plugin-svgr/client" /> |
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
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