-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (67 loc) · 1.68 KB
/
build.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
name: 'build'
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
name: Build, Check, Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 'latest'
- name: Setup node
uses: actions/setup-node@v3
with:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
- name: Build
env:
BASE_PATH: '/stromgedacht-web'
run: |
pnpm build
touch build/.nojekyll
- name: Check
run: pnpm check
- name: Lint
run: pnpm lint
- name: Archive artifact
shell: sh
if: runner.os == 'Linux'
run: |
chmod -c -R +rX "build/" | while read line; do
echo "::warning title=Invalid file permissions automatically fixed::$line"
done
tar \
--dereference --hard-dereference \
--directory "build/" \
-cvf "$RUNNER_TEMP/artifact.tar" \
--exclude=.git \
--exclude=.github \
.
- name: Upload artifact
uses: actions/upload-artifact@main
with:
name: github-pages
path: ${{ runner.temp }}/artifact.tar
retention-days: 30
deploy-demo:
name: Deploy
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1