Repository navigation
112 lines (112 loc) · 4.58 KB
/
Copy pathdevelop.yaml
File metadata and controls
112 lines (112 loc) · 4.58 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: "Deploy Develop"
on:
push:
branches:
- develop
workflow_dispatch:
inputs:
force_functions:
description: Redeploy all functions even when their inputs match
type: boolean
default: false
permissions:
contents: read
actions: read
concurrency:
group: deploy-csound-ide-dev
cancel-in-progress: false
jobs:
deploy-dev:
name: deploy-develop
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/develop'
# Allow recovery backoffs plus builds, API calls, and Hosting publication.
timeout-minutes: 300
env:
REACT_APP_DATABASE: DEV
steps:
- name: Checkout Repo
uses: actions/checkout@v7
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: "3.12"
cache: pip
cache-dependency-path: manual/requirements.txt
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- name: Install Dependencies
run: |
npm ci
npm ci --prefix functions
- name: Lint And Format Check
run: |
npm run lint
npm run typecheck
npm run format:check
- name: Authenticate dev deployment
uses: google-github-actions/auth@v3
with:
credentials_json: ${{ secrets.GCP_SA_KEY_DEV }}
- name: Check dev deployment permissions
run: node scripts/deploy-dev.mjs --preflight
- name: Build Csound checker
uses: ./.github/actions/csound-check
with:
cachix-auth-token: ${{ secrets.CACHIX_AUTH_TOKEN }}
- name: Build
run: |
echo "STORAGE_BUCKET_URL=gs://csound-ide-dev.appspot.com" >> functions/.env.dev
PUBLIC_URL="https://csound-ide-dev.web.app" npm run build:dev
cp dist/index.html functions
cd functions
npm run build
- name: Prepare dev deploy without Extensions
run: |
npm run test:deploy:dev
npm run test:access
npm run test:indexes
npm run prepare:deploy:dev
- name: Deploy Firestore indexes
# Preserve unrelated indexes and field settings; do not use --force.
run: ./functions/node_modules/.bin/firebase deploy -P develop --config firebase.json --only firestore:indexes --non-interactive
- name: Find last successful dev deployment
id: baseline
run: node scripts/deploy-dev.mjs --baseline
env:
GH_TOKEN: ${{ github.token }}
- name: Read previous function inputs
id: function-inputs
if: steps.baseline.outputs.run-id != ''
# A missing/expired artifact causes a full deploy, never a skip.
continue-on-error: true
uses: actions/download-artifact@v8
with:
name: dev-function-inputs
path: .firebase/previous-functions
run-id: ${{ steps.baseline.outputs.run-id }}
github-token: ${{ github.token }}
- name: Deploy to Firebase
run: node scripts/deploy-dev.mjs --functions
env:
FUNCTION_BASELINE_RESTORED: ${{ steps.function-inputs.outcome == 'success' }}
FORCE_FUNCTIONS: ${{ inputs.force_functions }}
- name: Apply dev browser access and check page loads
run: npm run access -- --env dev --apply
- name: Publish Hosting after functions are ready
run: ./functions/node_modules/.bin/firebase deploy -P develop --config firebase.dev.hosting.generated.json --only hosting --non-interactive
- name: Check published dev browser access
run: npm run access -- --env dev --check
- name: Save successful function inputs
uses: actions/upload-artifact@v7
with:
name: dev-function-inputs
path: .firebase/function-inputs.json
include-hidden-files: true
if-no-files-found: error
retention-days: 90
overwrite: true