-
Notifications
You must be signed in to change notification settings - Fork 5
94 lines (75 loc) · 3.1 KB
/
ci.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
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
94
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Continuous Integration
on: [push, pull_request]
concurrency:
group: ${{github.head_ref || github.ref}}
cancel-in-progress: true
jobs:
test-and-build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout
uses: actions/[email protected]
with:
# Required to get entire repository history for generating correct Markdown timestamps
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache ~/.pnpm-store
uses: actions/cache@main
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ matrix.node-version }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-${{ matrix.node-version }}
- name: Install PNPM
run: npm install -g [email protected]
- name: Install Packages
run: pnpm install --frozen-lockfile
- name: Lint
run: |
npm run lint:content
npm run lint:packages
- name: Test
run: npm run test:packages
- name: Build Application
run: npm run build:application
- name: Stash Pull Request
if: github.event_name == 'pull_request'
run: echo ${{github.event.number}} > ./packages/@kahi-docs-web/build/PULL_REQUEST
- name: Upload Documentation Build
uses: actions/upload-artifact@v2
if: |
github.event_name == 'pull_request' ||
github.ref == 'refs/heads/main'
with:
name: sveltekit-build
path: packages/@kahi-docs-web/build
publish:
runs-on: ubuntu-latest
needs: test-and-build
if: |
github.event_name != 'pull_request' &&
github.ref == 'refs/heads/main'
steps:
- name: Checkout
uses: actions/[email protected]
- name: Download Documentation Build
uses: actions/download-artifact@v2
with:
name: sveltekit-build
path: build
- name: Publish
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: build
git-config-name: github-actions[bot]
git-config-email: github-actions[bot]@users.noreply.github.com