-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (49 loc) · 1.35 KB
/
ci.yml
File metadata and controls
60 lines (49 loc) · 1.35 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
name: CI
on:
pull_request:
branches: [main, preview]
push:
branches: [preview]
workflow_dispatch:
schedule:
- cron: '0 2 * * *' # daily at 2am UTC — runs autosave cleanup
jobs:
build:
name: Build check
runs-on: ubuntu-latest
if: github.event_name != 'schedule'
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
NEXTAUTH_URL: https://dbirecoding.vercel.app
RUNNER_URL: https://code-runner-cpqt.onrender.com
RUNNER_API_KEY: dummy
cleanup:
name: Autosave cleanup
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install dependencies
run: npm ci
- name: Run autosave cleanup
run: npm run cleanup
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
AUTOSAVE_RETENTION_DAYS: 3