-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (64 loc) · 2.02 KB
/
ci.yml
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
name: CI
on:
push:
branches: [main, beta]
pull_request:
branches: [main, beta]
env:
# Setting this, because we're switching to netlify deployment, and they set
# the `BRANCH` environment variable, which we use in our A/B testing.
BRANCH: main
jobs:
test:
timeout-minutes: 60
# We're running on ubuntu-latest, nothing special
runs-on: ubuntu-latest
steps:
# As usual, we simply checkout the project
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
- name: Install dependencies
run: npm ci
# - name: Run lints
# run: npm run lint
# - name: Run checks
# run: npm run check
# - name: Install Playwright
# run: npx playwright install --with-deps
- name: Build and test site
run: npm run build
# And lastly, we upload the generated build/ folder as artifact so we can
# use it in later steps.
- name: Upload build and .svelte-kit folder
uses: actions/upload-artifact@v4
with:
name: build
if-no-files-found: error
path: build
retention-days: 1
deploy:
# Only run if merged to main.
if: github.ref == 'refs/heads/main'
# Only deploy if all tests passed.
needs: [test]
runs-on: ubuntu-latest
steps:
# No need to checkout the project, since all we need is to download the
# build artifact from the build step.
- uses: actions/download-artifact@v4
with:
name: build
path: build
# This seems to be the simplest way to publish to a separate branch.
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: ./build
# Optional. This will create a CNAME file so GitHub Pages serves it
# under this domain.
cname: www.dropzone.dev