Skip to content

tweaks to actions

tweaks to actions #7

name: Update GitHub Pages
# Trigger this workflow when a push is made to the master branch
on:
push:
branches:
- master
jobs:
update-pages:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- 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_test
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 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_test --force
# - name: Push changes
# uses: ad-m/github-push-action@v0.6.0
# with:
# branch: github_pages_test