Skip to content

Commit

Permalink
Deployment workflow (#68)
Browse files Browse the repository at this point in the history
- Fix deployment workflow
  • Loading branch information
cheehongw authored Nov 13, 2023
1 parent 7312c0a commit 6149e6a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deployment Workflow
on:
workflow_dispatch:
workflow_run:
workflows: ["Selectively Build and Push to Artifact Registry", Build and Push to Artifact Registry]
workflows: ["Selectively Build and Push to Artifact Registry", "Build and Push to Artifact Registry"]
types:
- completed

Expand All @@ -23,9 +23,6 @@ jobs:
with:
credentials_json: "${{ secrets.SERVICE_ACCOUNT_KEY }}"

- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v1"

- name: "Use gcloud CLI"
run: "gcloud info"

Expand All @@ -36,7 +33,7 @@ jobs:
instance_name: 'peerprep-prod'
zone: 'asia-southeast1-b'
ssh_private_key: '${{ secrets.SSH_KEY }}'
command: 'pwd | ~/test.txt'
command: 'echo "${{ secrets.ENV_FILE }}" | sudo tee /usr/src/peerprep/.env > /dev/null && sudo /usr/src/peerprep/scripts/init.sh'

- id: 'test'
run: |-
Expand Down
7 changes: 7 additions & 0 deletions scripts/init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

cd /usr/src/peerprep
git pull > test.txt
docker compose down >> test.txt
docker compose pull >> test.txt
docker compose up -d >> test.txt

0 comments on commit 6149e6a

Please sign in to comment.