File tree Expand file tree Collapse file tree 3 files changed +57
-27
lines changed
Expand file tree Collapse file tree 3 files changed +57
-27
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # This should be run inside GCP compute engine
3+
4+ # pull deploy branch
5+ cd ~ /projects/deepgit
6+ git pull origin deploy
7+
8+ # build and deploy the frontend
9+ cd ~ /projects/deepgit
10+ npm install
11+ rm -rf dist
12+ npm run build
13+ touch dist/$( git log -1 --pretty=format:%H)
14+ sudo rm -rf /var/www/deepgit-app/*
15+ sudo cp -rf ~ /projects/deepgit/dist/* /var/www/deepgit-app/.
16+
17+ # build and deploy the backend
18+ cd ~ /projects/deepgit
19+ cd backend
20+ ~ /projects/deepgit/.venv/bin/pip install -r requirements.txt
21+
22+ # restart nginx and gunicorn
23+ sudo systemctl restart nginx
24+ sudo systemctl restart gunicorn
25+
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ name : Deploy to Google Cloud Platform
2+ on :
3+ push :
4+ branches :
5+ - ' deploy'
6+
7+ jobs :
8+ deploy-to-vm :
9+ runs-on : ubuntu-latest # supporting Node 20
10+ permissions :
11+ contents : read
12+ id-token : write
13+
14+ steps :
15+ - uses : actions/checkout@v4
16+
17+ - id : ' auth'
18+ uses : google-github-actions/auth@v2
19+ with :
20+ project_id : ' deepgit'
21+ workload_identity_provider : ' projects/417733706772/locations/global/workloadIdentityPools/deployment/providers/github'
22+
23+ - name : ' Deploy'
24+ id : ' compute-ssh'
25+ uses : ' google-github-actions/ssh-compute@v1'
26+ with :
27+ instance_name : ' instance-1'
28+ project_id : ' deepgit'
29+ user : " user"
30+ zone : ' us-central1-f'
31+ ssh_private_key : ' ${{ secrets.GCP_SSH_PRIVATE_KEY }}'
32+ script : ${{ github.workspace }}/.github/scripts/deploy_deepgit.sh
You can’t perform that action at this time.
0 commit comments