-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (77 loc) · 2.47 KB
/
preview.yml
File metadata and controls
93 lines (77 loc) · 2.47 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
name: Preview
on:
push:
branches:
- main
jobs:
preview:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Restore
uses: ./.github/actions/restore
- name: Audit
continue-on-error: true
run: pnpm audit
- name: Format
run: pnpm format:check
- name: Lint
run: pnpm lint
- name: Typecheck
run: pnpm typecheck
- name: Test
run: pnpm test:coverage
- name: Build
run: pnpm build
- name: Migrate
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: |
pnpm wrangler d1 migrations apply \
solid-pages-preview \
--env preview \
--remote
- name: Deploy
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
run: >
pnpm wrangler pages deploy
--branch main
--commit-hash ${GITHUB_SHA}
--commit-message "[${GITHUB_SHA::7}] ${{ github.event.head_commit.message }}"
- name: End-to-End
uses: ./.github/actions/e2e
env:
BASE_URL: https://preview-solid-pages.phi.ag
E2E_CLIENT_ID: ${{ secrets.E2E_CLIENT_ID }}
E2E_CLIENT_SECRET: ${{ secrets.E2E_CLIENT_SECRET }}
- name: Upload End-to-End report
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
with:
path: reports/e2e
- name: Codecov test results
uses: codecov/test-results-action@0fa95f0e1eeaafde2c782583b36b28ad0d8c77d3 # v1
with:
files: ./junit.xml,./junit.e2e.xml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Codecov coverage
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
with:
files: ./reports/coverage/cobertura-coverage.xml
token: ${{ secrets.CODECOV_TOKEN }}
deploy:
runs-on: ubuntu-24.04
needs: preview
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy End-to-End report
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4