-
Notifications
You must be signed in to change notification settings - Fork 1
37 lines (37 loc) · 1.21 KB
/
update-docs.yml
File metadata and controls
37 lines (37 loc) · 1.21 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
name: Update Docs Revision And Database
on:
push:
branches: [ "main" ]
permissions:
contents: write
jobs:
check-docs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npx drizzle-kit migrate
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- run: npx tsx ./scripts/checkDocs.ts --write
env:
DATABASE_URL: ${{ secrets.DATABASE_URL }}
- name: Configure git for push
run: |
git remote set-url origin "https://github-actions:${GITHUB_TOKEN}@github.com/${{ github.repository }}"
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Commit build output
run: |
git add .
git diff --staged --exit-code || (git commit -m "[ci] update revisions.yml" && git push origin main)
# The `||` ensures the commit and push only happen if there are changes (git diff exits with non-zero)