File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 - name : Test
3232 run : npm test -- --run
3333
34+ deploy :
35+ needs : lint-and-test
36+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
37+ runs-on : ubuntu-latest
38+
39+ steps :
40+ - name : Checkout code
41+ uses : actions/checkout@v4
42+
43+ - id : ' auth'
44+ uses : ' google-github-actions/auth@v2'
45+ with :
46+ credentials_json : ' ${{ secrets.GCP_SA_KEY }}'
47+
48+ - name : Set up Google Cloud SDK
49+ uses : google-github-actions/setup-gcloud@v2
50+ with :
51+ project_id : ${{ secrets.GCP_PROJECT_ID }}
52+
53+ - name : Configure Docker for Google Cloud
54+ run : gcloud auth configure-docker
55+
56+ - name : Build Docker image
57+ run : |
58+ docker build -t gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.CLOUD_RUN_SERVICE }}:${{ github.sha }} .
59+
60+ - name : Push Docker image
61+ run : |
62+ docker push gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.CLOUD_RUN_SERVICE }}:${{ github.sha }}
63+
64+ - name : Deploy to Cloud Run
65+ run : |
66+ gcloud run deploy ${{ secrets.CLOUD_RUN_SERVICE }} \
67+ --image gcr.io/${{ secrets.GCP_PROJECT_ID }}/${{ secrets.CLOUD_RUN_SERVICE }}:${{ github.sha }} \
68+ --region ${{ secrets.CLOUD_RUN_REGION }} \
69+ --platform managed \
70+ --allow-unauthenticated \
71+ --set-env-vars ANTHROPIC_API_KEY=${{ secrets.ANTHROPIC_API_KEY }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments