Skip to content

Commit

Permalink
Add github workflow to build website
Browse files Browse the repository at this point in the history
  • Loading branch information
sua-ac committed Sep 17, 2024
1 parent 86e6bbf commit cbf7568
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 18 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: "Build website"

on:
push:

jobs:
build-website:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'
- run: |
pip install mkdocs-material
pip install mkdocs-awesome-pages-plugin
pip install mkdocs-charts-plugin
pip install mkdocs-static-i18n==0.56
- name: Create gh-pages branch
run: |
git checkout master
git branch -D gh-pages || true
git checkout --orphan gh-pages
- name: Build
run: |
mkdir /tmp/sua-ac-build
cd wiki
python -m mkdocs build
mv site /tmp/sua-ac-build/wiki
cd ..
cp -r main/* /tmp/sua-ac-build
- name: Clean everything and copy back websites
run: |
rm -rf *
cp -r /tmp/sua-ac-build/* .
- name: Push to github
run: |
git add -A
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
git commit -m "Build website"
git push -f origin gh-pages
18 changes: 0 additions & 18 deletions build.sh

This file was deleted.

0 comments on commit cbf7568

Please sign in to comment.