add: add linux pages and optization plugins. #24
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: ci | |
permissions: | |
contents: write | |
id-token: write | |
pages: write | |
on: | |
push: | |
branches: | |
- master | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
if: github.event.repository.fork == false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Configure Git Credentials | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: 3.x | |
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
with: | |
key: mkdocs-material-${{ env.cache_id }} | |
path: .cache | |
restore-keys: | | |
mkdocs-material- | |
- run: sudo apt install pngquant | |
- run: pip install git+https://${GH_TOKEN}@github.com/eglinuxer/mkdocs-material-insiders.git | |
- run: pip install mkdocs-git-revision-date-localized-plugin | |
- run: pip install mkdocs-git-committers-plugin-2 | |
- name: Build documentation | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
CI: true | |
GOOGLE_ANALYTICS_KEY: ${{ secrets.GOOGLE_ANALYTICS_KEY }} | |
run: | | |
mkdocs build --clean | |
mkdocs --version | |
- name: Set up Git | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
- name: Push to Target Branch | |
run: | | |
git checkout -b gh-pages | |
cp -r site/* . | |
rm -rf site | |
git add . | |
git commit -m "deploy docs changes to gh-pages" | |
git push origin gh-pages | |
env: | |
GH_TOKEN: ${{ secrets.GH_TOKEN }} |