TWTW Backend CD #113
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
name: TWTW Backend CD | |
on: | |
workflow_run: | |
branches: | |
- "master" | |
workflows: ["TWTW Backend CI"] | |
types: | |
- completed | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Google Cloud SDK | |
uses: google-github-actions/[email protected] | |
with: | |
version: '455.0.0' | |
project_id: ${{ secrets.GCP_PROJECT }} | |
service_account_key: ${{ secrets.GCP_KEY }} | |
export_default_credentials: true | |
- name: Deploy to GCE with Docker Compose | |
run: | | |
gcloud compute ssh twtw-instance --zone=${{ secrets.GCP_ZONE }} --command="cd ~/TWTW && sudo git pull && sudo docker-compose down && sudo docker-compose up --build -d" |