-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (32 loc) · 1.18 KB
/
Copy pathmain.yml
File metadata and controls
41 lines (32 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Deploy to Google Cloud Functions
on:
push:
branches:
- master
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- run: echo "Checked out $(git branch --show-current) at $(git log -1 --format=%H)"
- name: Authenticate Google Cloud CLI
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set PATH for gcloud
run: echo "PATH=/opt/hostedtoolcache/gcloud/472.0.0/x64/bin:$PATH" >> $GITHUB_ENV
- name: Setup Google Cloud CLI
uses: google-github-actions/setup-gcloud@v2
with:
version: '473.0.0' # Consider specifying a stable version known to work locally
- name: Log gcloud version
run: gcloud --version
- name: Deploy to Google Cloud Functions
run: gcloud builds submit --config cloudbuild.yaml
- name: Diagnose deployment
if: failure() # This step will run only if the previous step fails
run: |
echo "Deployment failed. Diagnostic information:"
echo "Detailed gcloud info:"
gcloud info --run-diagnostics