Fix github action #3
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: Deploy to Google Compute Engine | ||
on: | ||
push: | ||
branches: | ||
- dev # Replace with your branch | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build and push Docker image | ||
uses: actions/checkout@v3 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: arcade0425/snap_up_thsr:latest | ||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Google Cloud SDK | ||
uses: google-github-actions/setup-gcloud@v1 | ||
with: | ||
project_id: ${{ secrets.GCP_PROJECT_ID }} | ||
service_account_key: ${{ secrets.GCP_SA_KEY }} | ||
export_default_credentials: true | ||
- name: Deploy to GCE | ||
run: | | ||
Check failure on line 32 in .github/workflows/deploy-docker-gce.yml GitHub Actions / Deploy to Google Compute EngineInvalid workflow file
|
||
gcloud compute ssh ${{ secrets.GCP_USER }}@${{ secrets.GCP_INSTANCE }} --zone=${{ variables.INSTANCE_REGION }} -- "cd snap_up_thsr && \ | ||
docker pull arcade0425/snap_up_thsr:latest && \ | ||
docker run --network=${{ secrets.LIVE_NETWORK }} \ | ||
-p 8080:8000 \ | ||
-e REDIS_HOST=${{ secrets.REDIS_HOST }} \ | ||
-e DB_HOST=${{ secrets.DB_HOST }} \ | ||
-e DB_USER=${{ secrets.DB_USER }} \ | ||
-e DB_PASSWORD=${{ secrets.DB_PASSWORD }} \ | ||
-e DB_NAME=${{ secrets.DB_NAME }} \ | ||
-e deploy=live \ | ||
-d \ | ||
--restart=always \ | ||
--name snap_up_thsr \ | ||
arcade0425/snap_up_thsr:latest |