-
-
Notifications
You must be signed in to change notification settings - Fork 1
79 lines (68 loc) · 1.89 KB
/
ci-cd.yml
File metadata and controls
79 lines (68 loc) · 1.89 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
name: Deploy
on:
push:
branches: ["main"]
paths-ignore:
- "public/tools-collection/**"
- "public/tools.json"
workflow_dispatch:
jobs:
build-test:
runs-on: ubuntu-latest
name: Build and Test
permissions:
contents: write
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Cache Bun dependencies
uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Generate specifications
run: bun run specification:build
- name: Build registry
run: bun run registry:build
- name: Commit changes if any
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if git diff --quiet; then
echo "No changes to commit"
else
git add .
git commit -m "chore: update generated specifications and registry"
git push origin HEAD:main
fi
- run: bun run build
# - run: bun run test
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v4
with:
path: ./dist/client
deploy:
runs-on: ubuntu-latest
permissions:
id-token: write
pages: write
environment:
name: github-pages
url: ${{steps.deployment.outputs.page_url}}
needs: build-test
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4