-
Notifications
You must be signed in to change notification settings - Fork 5
74 lines (60 loc) · 1.81 KB
/
gcr-deploy.yaml
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: build
on:
push:
branches:
- main
workflow_dispatch:
# Environment variables available to all jobs and steps in this workflow
env:
RUN_PROJECT: ${{ secrets.RUN_PROJECT }}
RUN_REGION: ${{ secrets.RUN_REGION }}
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Build
run: |
docker build \
--build-arg COMMIT=${GITHUB_SHA:0:7} \
--build-arg LASTMOD=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
--tag gcr.io/$RUN_PROJECT/logosearch:$GITHUB_SHA .
- name: GCloud auth
id: 'auth'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: GCloud cli setup
uses: google-github-actions/setup-gcloud@v0
- name: GCloud docker auth
run: |
gcloud auth configure-docker
- name: Push to registry
run: |
docker push gcr.io/$RUN_PROJECT/logosearch:$GITHUB_SHA
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
RUN_SERVICE: [ emojisearch, iconsearch, logosearch, supertinyicons, unicodesearch ]
steps:
- name: GCloud auth
id: 'auth'
uses: 'google-github-actions/auth@v0'
with:
credentials_json: '${{ secrets.GCP_SA_KEY }}'
- name: GCloud cli setup
uses: google-github-actions/setup-gcloud@v0
- name: Deploy ${{ matrix.RUN_SERVICE }}
run: |
gcloud run deploy ${{ matrix.RUN_SERVICE }} \
--allow-unauthenticated \
--image gcr.io/${RUN_PROJECT}/logosearch:$GITHUB_SHA \
--platform managed \
--project ${RUN_PROJECT} \
--region ${RUN_REGION}