Skip to content

Commit 404802f

Browse files
authored
Merge pull request #21 from cindytsai/deploy
GitHub Action deploy (so that I can trigger the branch.)
2 parents bf41e33 + cb24f5f commit 404802f

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/deploy_gcp.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Deploy to Google Cloud Platform
2+
on:
3+
push:
4+
branches:
5+
- 'deploy'
6+
workflow_dispatch: # TODO: should be removed when the workflow is stable
7+
8+
jobs:
9+
deploy-to-vm:
10+
runs-on: ubuntu-latest # supporting Node 20
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- id: 'auth'
19+
uses: google-github-actions/auth@v2
20+
with:
21+
project_id: 'deepgit'
22+
workload_identity_provider: 'projects/417733706772/locations/global/workloadIdentityPools/deployment/providers/github'
23+
24+
- id: 'compute-ssh'
25+
uses: 'google-github-actions/ssh-compute@v1'
26+
with:
27+
instance_name: 'instance-1'
28+
zone: 'us-central1-f'
29+
ssh_private_key: '${{ secrets.GCP_SSH_PRIVATE_KEY }}'
30+
command: 'echo Hello world'
31+
32+
- id: 'test'
33+
run: |-
34+
echo '${{ steps.compute-ssh.outputs.stdout }}'
35+
echo '${{ steps.compute-ssh.outputs.stderr }}'

0 commit comments

Comments
 (0)