Skip to content

Commit

Permalink
add deploy to google cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
smltr committed Aug 18, 2024
1 parent b3bcf6b commit 89de47e
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Deploy to Google Cloud

on:
push:
branches:
- main # Trigger deployment on push to main branch

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Google Cloud SDK
uses: google-github-actions/[email protected]
with:
version: 'latest'
project_id: ${{ secrets.PROJECT_ID }}
service_account_key: ${{ secrets.GOOGLE_CREDENTIALS }}

- name: Deploy to Google Compute Engine
run: |
gcloud compute ssh ${{ secrets.INSTANCE_NAME }} \
--project ${{ secrets.PROJECT_ID }} \
--zone ${{ secrets.ZONE }} \
--command "cd /home/trouys16/Jobby && git pull origin main && pnpm i && pnpm run start"

0 comments on commit 89de47e

Please sign in to comment.