File tree 2 files changed +68
-1
lines changed
2 files changed +68
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : deploy
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+
8
+ workflow_dispatch :
9
+
10
+ # Environment variables available to all jobs and steps in this workflow
11
+ # NOTE: these aren't really secret, but there aren't non-secret settings
12
+ env :
13
+ RUN_PROJECT : ${{ secrets.RUN_PROJECT }}
14
+ RUN_REGION : ${{ secrets.RUN_REGION }}
15
+ RUN_SERVICE : ${{ secrets.RUN_SERVICE }}
16
+
17
+ jobs :
18
+ deploy :
19
+ name : Deploy to CloudRun
20
+ runs-on : ubuntu-latest
21
+
22
+ steps :
23
+ - name : Checkout
24
+ uses : actions/checkout@v1
25
+
26
+ - name : gcloud auth
27
+ id : ' auth'
28
+ uses : ' google-github-actions/auth@v0'
29
+ with :
30
+ credentials_json : ' ${{ secrets.GCP_SA_KEY }}'
31
+
32
+ # Setup gcloud CLI
33
+ - name : gcloud setup
34
+ uses : google-github-actions/setup-gcloud@v0
35
+
36
+ - name : gcloud docker-auth
37
+ run : gcloud auth configure-docker
38
+
39
+ # Build and push image to Google Container Registry
40
+ - name : Build
41
+ run : |
42
+ docker build \
43
+ --build-arg COMMIT=${GITHUB_SHA:0:7} \
44
+ --build-arg LASTMOD=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
45
+ --tag gcr.io/${RUN_PROJECT}/${RUN_SERVICE}:$GITHUB_SHA \
46
+ .
47
+
48
+ - name : GCloud auth to docker
49
+ run : |
50
+ gcloud auth configure-docker
51
+
52
+ - name : Push to registry
53
+ run : |
54
+ docker push gcr.io/${RUN_PROJECT}/${RUN_SERVICE}:$GITHUB_SHA
55
+
56
+ # Deploy image to Cloud Run
57
+ - name : Deploy
58
+ run : |
59
+ gcloud run deploy ${RUN_SERVICE} \
60
+ --allow-unauthenticated \
61
+ --image gcr.io/${RUN_PROJECT}/${RUN_SERVICE}:$GITHUB_SHA \
62
+ --platform managed \
63
+ --project ${RUN_PROJECT} \
64
+ --region ${RUN_REGION}
Original file line number Diff line number Diff line change 29
29
## Credits
30
30
31
31
[ ![ Google CloudRun] ( https://www.vectorlogo.zone/logos/google_cloud_run/google_cloud_run-ar21.svg )] ( https://cloud.google.com/run/ " Hosting ")
32
+ [ ![ Docker] ( https://www.vectorlogo.zone/logos/docker/docker-ar21.svg )] ( https://www.docker.com/ " Deployment ")
32
33
[ ![ Git] ( https://www.vectorlogo.zone/logos/git-scm/git-scm-ar21.svg )] ( https://git-scm.com/ " Version control ")
33
34
[ ![ Github] ( https://www.vectorlogo.zone/logos/github/github-ar21.svg )] ( https://github.com/ " Code hosting ")
34
- [ ![ Google Noto Emoji] ( https://www.vectorlogo.zone/logos/google/google-ar21.svg )] ( https://github.com/googlefonts/noto-emoji/blob/master/svg/emoji_u1f441.svg " Logo/Favicon ") [ ![ NodePing] ( https://www.vectorlogo.zone/logos/nodeping/nodeping-ar21.svg )] ( https://nodeping.com?rid=201109281250J5K3P " Uptime monitoring ")
35
+ [ ![ Google Noto Emoji] ( https://www.vectorlogo.zone/logos/google/google-ar21.svg )] ( https://github.com/googlefonts/noto-emoji/blob/master/svg/emoji_u1f441.svg " Logo/Favicon ")
36
+ [ ![ Node.js] ( https://www.vectorlogo.zone/logos/nodejs/nodejs-ar21.svg )] ( https://nodejs.org/ " Application Server ")
37
+ [ ![ NodePing] ( https://www.vectorlogo.zone/logos/nodeping/nodeping-ar21.svg )] ( https://nodeping.com?rid=201109281250J5K3P " Uptime monitoring ")
35
38
[ ![ npm] ( https://www.vectorlogo.zone/logos/npmjs/npmjs-ar21.svg )] ( https://www.npmjs.com/ " JS Package Management ")
36
39
[ ![ Phosphor Icons] ( https://www.vectorlogo.zone/logos/phosphoricons/phosphoricons-ar21.svg )] ( https://phosphoricons.com/ " Toolbar icons ")
37
40
[ ![ react.js] ( https://www.vectorlogo.zone/logos/reactjs/reactjs-ar21.svg )] ( https://reactjs.org/ " UI Framework ")
You can’t perform that action at this time.
0 commit comments