-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (50 loc) · 1.37 KB
/
buildanddeploy.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
name: Test, build and Deploy
on: [push]
permissions:
contents: write
jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 20
- name: Install packages
run: yarn install
- name: Run tests
run: |
sudo apt-get install xvfb
xvfb-run --auto-servernum yarn test
- name: Report test results
uses: mikepenz/action-junit-report@v3
with:
report_paths: '**/TESTS-*.xml'
- name: Build for GitHub pages
run: |
yarn build-gh-pages
cp 404header.html dist/sr-app/404.html
cat dist/sr-app/index.html >> dist/sr-app/404.html
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist/sr-app
deploy:
needs: test-and-build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts
path: dist/sr-app
- name: Deploy to gh-pages branch
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: dist/sr-app