website: deploy website from GitHub Actions (#3237)

Deploying GitHub Pages from the gh-pages branch is a classic way.
We can use actions/deploy-pages action to deploy GitHub Pages.
This commit is contained in:
itchyny authored and GitHub committed 2025-01-28 11:40:55 +09:00
1 parent da28628edd
commit 39eea145b4
2 files changed
+24 -47

No files matched your search

-30
View File
@@ -1,30 +0,0 @@
#!/bin/bash
# This script builds the website from the docs directory of
# the current branch and copies it over to the gh-pages
# branch.
set -eux
shopt -s dotglob
# build website
scriptdir=$(dirname "$0")
cd "$scriptdir"/../docs
rm -rf output
mkdir output
pipenv run python3 build_website.py
cd ..
# copy to /tmp
tmpdir=$(mktemp -d -t jq.website.XXXXXXXXXX)
cp -r docs/output/* "$tmpdir"
cp .gitignore "$tmpdir"
# copy to gh-pages
git checkout gh-pages
cp -r "$tmpdir"/* .
cp "$tmpdir"/.gitignore .
# clean up
rm -rf "$tmpdir"
echo SUCCESS