-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (46 loc) · 1.62 KB
/
deploy_github_pages.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
#
# This workflow requires writing permissions to the repository.
# The GITHUB_TOKEN provided by the runner defaults to read-only permissions.
# Remember to add write permissions in `Settings -> Action -> General -> Workflow permissions`
# TODO: use the official github pages workflow.
# We are currently pushing build artifacts to a branch, which is stupid.
# https://github.com/actions/upload-pages-artifact
name: Update GitHub Pages
on:
push:
branches:
- master
jobs:
update-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.11.1' # TODO: nix! reproducible builds! & a sprinkle of professionalism
- name: Merge master into github_pages
run: |
git fetch origin
git checkout github_pages
git reset --hard origin/master
- name: Install dependencies and build the web project
working-directory: ./svelte_blinkenweb
run: |
npm ci
npm run build
- name: Remove old /docs content
run: |
rm -rf ./docs/*
- name: Copy build to /docs
run: |
cp -r ./svelte_blinkenweb/dist/* ./docs/
- name: Commit and push changes
run: |
# Note: the following account information will not work on GHES
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add --all
git commit -m "Update GitHub Pages with latest build from master"
git push origin github_pages --force