-
Notifications
You must be signed in to change notification settings - Fork 1
59 lines (48 loc) · 1.46 KB
/
frontend.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
name: Build 11ty frontend
on:
push:
branches:
- main
- develop
schedule:
- cron: "*/30 7-22 * * *"
jobs:
build:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: create env file
run: |
touch frontend/.env
echo BUILD_DRAFTS=true >> frontend/.env
echo DIRECTUS_URL=${{ secrets.DIRECTUS_URL }} >> frontend/.env
- name: Install dependencies
run: |
npm ci -w frontend
# force getting data from the CMS
rm frontend/src/_data/_*.json
- name: Test frontend
run: npm run frontend:test
- name: Build frontend
run: |
npm run build -w frontend -- --pathprefix 'kdl'
npm run index -w frontend
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "ci(frontend): update data"
file_pattern: "frontend/src/_data/*.json frontend/public/assets/images/projects/*.*"
- name: Deploy to GitHub pages
if: github.ref == 'refs/heads/develop'
uses: peaceiris/actions-gh-pages@v3
with:
publish_dir: ./frontend/_site
github_token: ${{ secrets.GITHUB_TOKEN }}