mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
add gcp staging deployment action
This commit is contained in:
parent
0965f1d3eb
commit
a66e3493f7
1 changed files with 30 additions and 0 deletions
30
.github/workflows/gcp-deploy-staging.yml
vendored
Normal file
30
.github/workflows/gcp-deploy-staging.yml
vendored
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
name: GCP Deploy (staging)
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
workflows: ["Publish to ghcr (staging)"]
|
||||
types:
|
||||
- completed
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy staging app to GCP
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Configure SSH
|
||||
run: |
|
||||
mkdir -p ~/.ssh/
|
||||
echo "${{ secrets.GCP_STAGING_SSH_PRIVATE_KEY }}" > ~/.ssh/private.key
|
||||
chmod 600 ~/.ssh/private.key
|
||||
echo "${{ secrets.GCP_STAGING_SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Deploy to GCP
|
||||
run: |
|
||||
ssh -i ~/.ssh/private.key {{secrets.GCP_STAGING_USERNAME}}@${{ secrets.GCP_STAGING_HOST }} << 'EOF'
|
||||
# Stop existing container (if running)
|
||||
staging_stop || true
|
||||
|
||||
# Start new container
|
||||
staging_start
|
||||
EOF
|
||||
Loading…
Reference in a new issue