-
Notifications
You must be signed in to change notification settings - Fork 25
49 lines (44 loc) · 1.78 KB
/
ci-and-cd.yml
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
name: CI & CD
on:
# Trigger the workflow on pushes to the main branch, including PR merges:
push:
branches:
- main
# Generate a GitHub token that can be exchanged with Google Cloud - see
# https://github.com/google-github-actions/auth/tree/v0.6.0#setting-up-workload-identity-federation
permissions:
contents: read
id-token: write
deployments: write
jobs:
test-and-build:
name: Integration
uses: ./.github/workflows/test-and-build.yml
secrets: inherit
deploy-to-staging:
name: Staging
uses: ./.github/workflows/deploy-to-cloud-run.yml
needs:
- test-and-build
with:
environment: staging
deploy-name: staging
cloud-sql-instance: sepomex-365521:us-central1:sepomex
cloud-sql-username-secret: database-username:latest
cloud-sql-password-secret: database-password:latest
cloud-run-service-suffix: ${{ needs.test-and-build.outputs.git-commit-short-sha }}
cloud-run-container-image: us-central1-docker.pkg.dev/sepomex-365521/icalialabs-sepomex/sepomex@${{ needs.test-and-build.outputs.container-image-digest }}
deploy-to-production:
name: Production
uses: ./.github/workflows/deploy-to-cloud-run.yml
needs:
- test-and-build
with:
environment: production
deploy-name: production
cloud-sql-instance: sepomex-365521:us-central1:sepomex
cloud-sql-username-secret: database-username:latest
cloud-sql-password-secret: database-password:latest
cloud-run-service-suffix: ${{ needs.test-and-build.outputs.git-commit-short-sha }}
cloud-run-container-image: us-central1-docker.pkg.dev/sepomex-365521/icalialabs-sepomex/sepomex@${{ needs.test-and-build.outputs.container-image-digest }}
# cloud-run-minimum-instances: 1 # Uncomment once we want it to be always on