Repository navigation
Expand file tree
/
Copy pathcloudbuild.yaml
More file actions
83 lines (83 loc) · 2.83 KB
/
Copy pathcloudbuild.yaml
File metadata and controls
83 lines (83 loc) · 2.83 KB
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
75
76
77
78
79
80
81
82
83
steps:
# keep in sync with REQUIRED_APIS in scripts/localess/apis.mjs (enforced by apis.test.mjs)
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk'
id: 'enable-apis'
entrypoint: 'bash'
allowFailure: true
args:
- '-c'
- |
gcloud services enable \
firebase.googleapis.com \
firebasehosting.googleapis.com \
firebaserules.googleapis.com \
firestore.googleapis.com \
identitytoolkit.googleapis.com \
firebasestorage.googleapis.com \
firebaseextensions.googleapis.com \
cloudfunctions.googleapis.com \
cloudbuild.googleapis.com \
artifactregistry.googleapis.com \
run.googleapis.com \
eventarc.googleapis.com \
pubsub.googleapis.com \
storage.googleapis.com \
translate.googleapis.com \
--project=$PROJECT_ID
- name: 'node:24'
id: 'install-deps'
entrypoint: npm
args: [ 'install' ]
- name: 'node:24'
id: 'install-functions-deps'
entrypoint: npm
args: [ '--prefix', 'functions', 'install', '--platform=linuxmusl' ]
- name: 'bash'
id: 'generate-functions-env'
args:
- '-c'
- |
echo "REGION=${_REGION}" > functions/.env.$PROJECT_ID
# firebase-config.json is tracked and holds the demo placeholder; the build swaps in this
# file via the `deploy` configuration in angular.json, so nothing tracked is modified.
- name: ghcr.io/lessify/firebase:edge
id: 'Pull Firebase Apps SDK Config'
args: [ 'apps:sdkconfig', '--project=$PROJECT_ID', 'web', '--out=src/environments/firebase-config.build.json' ]
- name: 'node:24'
id: 'version-generate'
entrypoint: npm
args:
- 'run'
- 'version:generate'
env:
- 'COMMIT_SHA=$COMMIT_SHA'
- name: 'node:24'
id: 'build-prod'
entrypoint: npm
args:
- 'run'
- 'build:deploy'
- '--'
- '--define'
- 'LOCALESS_REGION="${_REGION}"'
- '--define'
- 'LOCALESS_AUTH_CUSTOM_DOMAIN="${_LOCALESS_AUTH_CUSTOM_DOMAIN}"'
- '--define'
- 'LOCALESS_AUTH_PROVIDERS="${_LOCALESS_AUTH_PROVIDERS}"'
- '--define'
- 'LOCALESS_LOGIN_MESSAGE="${_LOCALESS_LOGIN_MESSAGE}"'
- '--define'
- 'LOCALESS_UNSPLASH_ENABLE="${_LOCALESS_UNSPLASH_ENABLE}"'
# apply the region to the /api/v1/** hosting rewrite without touching tracked firebase.json
- name: 'node:24'
id: 'generate-firebase-json'
entrypoint: node
args: [ 'scripts/generate-firebase-json.mjs', '$PROJECT_ID', '${_REGION}' ]
# deploy to firebase
- name: ghcr.io/lessify/firebase:edge
id: 'firebase-deploy'
args: [ 'deploy', '--config=firebase.$PROJECT_ID.json', '--project=$PROJECT_ID', '--only=hosting,functions,storage,firestore,auth', '--force' ]
options:
logging: CLOUD_LOGGING_ONLY
substitutions:
_REGION: europe-west6