-
Notifications
You must be signed in to change notification settings - Fork 0
139 lines (100 loc) · 2.99 KB
/
Copy pathtest.yml
File metadata and controls
139 lines (100 loc) · 2.99 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Test and Deploy
on:
push:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "22"
- name: Install dependencies
run: npm ci
- name: Lint
run: npx biome lint
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "22"
- name: Install dependencies
run: npm ci
- name: Format
run: npx biome format
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "22"
- name: Install dependencies
run: npm ci
- name: Check compilation errors on TypeScript files
run: npx tsc --noEmit && npx tsc --project functions --noEmit
- name: Generate dist
run: npm run build
- name: Setup Firebase CLI
run: npm install -g firebase-tools
- name: Run Test
run: npm test
deploy_firebase:
name: Deploy Firebase Configurations
needs: [lint, format, test]
# if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
# Disabled temporary
if: ${{ false }}
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- uses: actions/setup-node@v7
with:
node-version: "22"
- name: Install Dependencies
run: npm ci
- name: Setup Python
uses: actions/setup-python@v7
with:
python-version: "3.13"
- name: Create virtual environment and install Python dependencies
run: |
cd python-functions
python3.13 -m venv venv
source venv/bin/activate
pip install -r requirements.txt
- name: Restore .env file from secrets
run: echo "${{secrets.FUNCTIONS_DOTENV}}" > functions/.env
- name: Deploy to Firebase
run: |
cd python-functions
source venv/bin/activate
cd ..
npx firebase deploy --except hosting --token "$FIREBASE_TOKEN"
env:
FIREBASE_TOKEN: "${{ secrets.FIREBASE_TOKEN }}"
ESLINT_USE_FLAT_CONFIG: "false"
deploy_hosting:
name: Deploy Firebase Hosting
needs: [lint, format, test]
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: "22"
- run: npm ci
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT_ARC_CODEGOLF }}"
channelId: live
projectId: arc-codegolf