-
Notifications
You must be signed in to change notification settings - Fork 43
65 lines (57 loc) · 1.59 KB
/
build.yaml
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
name: build
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install --frozen-lockfile
- run: bun pre-commit
- run: bun run test
- run: ./check-lines.sh
build:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v1
- run: bun install --frozen-lockfile
- run: bun run build
- name: Upload built project
uses: actions/upload-artifact@v4
with:
path: ./dist
overwrite: true
retention-days: 1
name: build-artifacts-${{ github.run_id }}
deploy:
if: github.ref == 'refs/heads/master' && github.repository == 'commaai/new-connect'
needs: [build, test]
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts-${{ github.run_id }}
path: ./dist
run-id: ${{ github.run_id }}
github-token: ${{ secrets.GITHUB_TOKEN }}
# deploy
- name: Deploy to Cloudflare Pages
id: cloudflare-publish
uses: cloudflare/[email protected]
with:
directory: dist
branch: new-connect
projectName: connect
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
apiToken: ${{ secrets.CLOUDFLARE_PAGES_TOKEN }}
wranglerVersion: '3'