-
Notifications
You must be signed in to change notification settings - Fork 1
78 lines (66 loc) · 1.58 KB
/
client.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
name: Client
on:
push:
branches:
- main
paths:
- client/**
- .github/**
- CNAME
pull_request:
branches:
- main
workflow_dispatch:
defaults:
run:
working-directory: ./client
jobs:
build-client:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: npm
cache-dependency-path: client/package-lock.json
node-version-file: client/package.json
- name: Check CLI tools
run: |
for tool in node npm; do
if ! command -v $tool &> /dev/null; then
echo "${tool} is not installed"
exit 1
fi
${tool} --version
done
- name: Install dependencies
run: |
npm ci
- name: Build
run: |
npm run build --if-present
cp ./dist/index.html ./dist/404.html
- name: Unit tests
run: |
npm run test:unit
- name: E2E tests
run: |
npm run test:e2e
- name: Deploy
if: ${{ github.ref == 'refs/heads/main' }}
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: client/dist
allow_empty_commit: false
keep_files: false
force_orphan: true
cname: edu.exokomodo.com
- name: Send status to Discord
uses: nebularg/actions-discord-webhook@v1
if: always()
with:
webhook_url: ${{ secrets.DISCORD_CI_WEBHOOK }}
status: ${{ job.status }}