WIP: fixing readme gen and theming #24
This file contains hidden or 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: build-deploy-gh-pages | |
on: | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- 'README.md' # Ignore README.md changes to prevent infinite loops | |
env: | |
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
CUSTOM_DOMAIN: awesome.video | |
CONFIG_FILE: mkdocs.yml | |
EXTRA_PACKAGES: build-base | |
REQUIREMENTS: requirements.txt | |
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 | |
jobs: | |
awesomebot: | |
runs-on: ubuntu-latest | |
container: | |
image: ruby:latest | |
steps: | |
- uses: actions/checkout@v3.5.0 | |
- name: install awesomebot | |
run: gem install awesome_bot | |
- name: run awesomebot | |
run: awesome_bot contents.json --allow-ssl --allow-redirect -a 403,503,429,404,500,443 | |
json-validate: | |
runs-on: ubuntu-latest | |
container: | |
image: python:3.7.12 | |
steps: | |
- uses: actions/checkout@v3.5.0 | |
- name: install json-spec | |
run: pip install json-spec | |
- name: run json validate | |
run: json validate --schema-file=.github/schema.json --document-file=contents.json | |
gen-awesome-video: | |
runs-on: ubuntu-latest | |
needs: | |
- awesomebot | |
- json-validate | |
steps: | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.7 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PERSONAL_TOKEN }} | |
- name: Generate README.md from contents.json | |
run: ruby .github/convert.rb | |
- name: Commit README.md back to master if it changed | |
run: | | |
git config --global user.name 'GitHub Action' | |
git config --global user.email 'action@github.com' | |
git add README.md | |
if git diff --cached --exit-code; then | |
echo "No changes to README.md" | |
else | |
git commit -m "[ci skip] Auto-update README.md from contents.json" | |
git push | |
fi | |
- name: Generate database.json | |
run: node .github/upgradeDb.js | |
- name: Install mkdocs build dependencies | |
run: sudo apt-get update && sudo apt-get -y install lsb-release unzip python3-pip python3-dev && pip3 install mkdocs mkdocs-material pymdown-extensions mkdocs-minify-plugin json-spec | |
- name: Install all dependencies via makefile | |
run: make site_install | |
- name: Build MkDocs site | |
run: make site_build | |
- name: Deploy docs to GitHub Pages | |
uses: mhausenblas/mkdocs-deploy-gh-pages@master | |
with: | |
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
PERSONAL_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | |
CONFIG_FILE: mkdocs.yml | |
EXTRA_PACKAGES: build-base | |
REQUIREMENTS: requirements.txt | |
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1 | |
CUSTOM_DOMAIN: awesome.video |