Skip to content

Fix github action

Fix github action #3

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

View workflow run for this annotation

GitHub Actions / Deploy to Google Compute Engine

Invalid workflow file

The workflow is not valid. .github/workflows/deploy-docker-gce.yml (Line: 32, Col: 12): Unrecognized named-value: 'variables'. Located at position 1 within expression: variables.INSTANCE_REGION
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