This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
cleanup #220
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 - | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Build Yuui | |
run: | | |
cd yuui | |
npm i --include=dev | |
echo "VITE_BUILD_COMMIT=gh-$(git rev-parse --short @)" >> .env.production | |
npm run build | |
- name: Install mdbook | |
run: | | |
mkdir mdbook | |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook | |
echo `pwd`/mdbook >> $GITHUB_PATH | |
- name: Build Paimon | |
run: | | |
cd paimon | |
mdbook build | |
- name: Deploy GitHub Pages | |
run: | | |
git worktree add gh-pages gh-pages | |
git config user.name "Deploy from CI" | |
git config user.email "" | |
cd gh-pages | |
# Delete the ref to avoid keeping history. | |
git update-ref -d refs/heads/gh-pages | |
rm -rf ./* | |
mv ../CNAME . | |
touch ./.nojekyll | |
mv ../yuui/build/* ./ | |
mv ../paimon/book ./paimon | |
git add . | |
git commit -m "Deploy $GITHUB_SHA to gh-pages" | |
git push --force |