File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ name: Deploy Website to Cloud Run
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - website/**
7
+
8
+ env:
9
+ GEN: "workshop"
10
+
11
+ jobs:
12
+ deploy:
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - name: Checkout code
17
+ uses: actions/checkout@v2
18
+
19
+ - id: "auth"
20
+ uses: "google-github-actions/auth@v0"
21
+ with:
22
+ credentials_json: ${{ secrets.GCP_CREDENTIALS }}
23
+
24
+ - name: Set up Google Cloud SDK
25
+ uses: google-github-actions/setup-gcloud@v0
26
+
27
+ - name: Configure Docker to use gcloud as a credential helper
28
+ run: |
29
+ gcloud auth configure-docker
30
+
31
+ - name: Build Website Docker image
32
+ run: |
33
+ docker build -t gcr.io/summit-enterprise-workshop/${{github.actor}}-website:latest .
34
+ docker images
35
+ working-directory: ./website
36
+
37
+ - name: Push Docker image to Google Container Registry
38
+ run: |
39
+ docker push gcr.io/summit-enterprise-workshop/${{github.actor}}-website:latest
40
+ working-directory: ./website
41
+
42
+ - name: Deploy Website to Cloud Run
43
+ run: |
44
+ gcloud run deploy ${{github.actor}}-orders \
45
+ --image gcr.io/summit-enterprise-workshop/${{github.actor}}-website:latest \
46
+ --platform managed \
47
+ --region us-central1 \
48
+ --update-env-vars APOLLO_KEY=${{ secrets.APOLLO_KEY }},APOLLO_GRAPH_REF=${{ secrets.APOLLO_GRAPH_REF }} \
49
+ --allow-unauthenticated
50
+ - name: Get URL
51
+ run: |
52
+ gcloud run services describe ${{vars.ACTOR}}-website --region us-central1 --format 'value(status.url)' > url.json
53
+ echo "::notice URL=$(cat url.json)"
You can’t perform that action at this time.
0 commit comments