ci: deploy the website from GitHub Actions

This commit is contained in:
Emily 2025-03-28 15:23:02 +00:00
parent a5af2a5b22
commit 2c77fdbfba
4 changed files with 76 additions and 35 deletions

View file

@ -1,35 +0,0 @@
name: Update manual
on:
push:
branches:
- master
jobs:
update-manual:
runs-on: macos-13
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
# So that we fetch all branches, since we need to checkout the `gh-pages` branch later.
fetch-depth: 0
- name: Install Nix
uses: cachix/install-nix-action@v30
- name: Build manual
run: |
nix build .#manualHTML
- name: Push update to manual
run: |
git checkout gh-pages
rm -rf manual
cp -R result/share/doc/darwin manual
rm result
git checkout master -- README.md
git config user.name github-actions
git config user.email github-actions@github.com
git add --all
git commit -m "Update manual"
git push

45
.github/workflows/update-website.yml vendored Normal file
View file

@ -0,0 +1,45 @@
name: Update website
on:
push:
branches:
- master
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build
runs-on: macos-14
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
with:
persist-credentials: false
- name: Install Nix
uses: cachix/install-nix-action@02a151ada4993995686f9ed4f1be7cfbb229e56f
- name: Build website
run: nix build .#website -o _site
- name: Upload website
id: deployment
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa
# See: <https://github.com/actions/deploy-pages?tab=readme-ov-file#usage>
deploy:
name: Deploy
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-24.04
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e