diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b872761..860dbbf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,11 +1,16 @@ name: ci + +permissions: + contents: write + id-token: write + pages: write + on: push: branches: - master - main -permissions: - contents: write + jobs: deploy: runs-on: ubuntu-latest @@ -26,10 +31,33 @@ jobs: path: .cache restore-keys: | mkdocs-material- - - run: sudo apt update;sudo apt install pngquant + - 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 - - run: mkdocs gh-deploy --force + - 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 config pull.rebase true + git checkout -b gh-pages + git pull origin 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 }} \ No newline at end of file diff --git a/docs/linux/index.md b/docs/linux/index.md new file mode 100644 index 0000000..be9c19f --- /dev/null +++ b/docs/linux/index.md @@ -0,0 +1,6 @@ +--- +hide: + - footer +--- + +# Linux \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 339a1eb..00ee692 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -69,14 +69,19 @@ theme: plugins: - search - - git-revision-date-localized: - enable_creation_date: true - - git-committers: - repository: eglinuxer/eglinux - branch: main - token: !ENV GH_TOKEN - - projects - - optimize + + # Continuous integration + - group: + enabled: !ENV CI + plugins: + - git-revision-date-localized: + enable_creation_date: true + type: timeago + - git-committers: + repository: eglinuxer/eglinux + token: !ENV GH_TOKEN + - optimize + - projects extra: homepage: https://www.eglinux.com @@ -101,6 +106,8 @@ nav: - 读书: eglinux/book.md - 课程: eglinux/course.md - 赞助: eglinux/support_me.md + - Linux: + - linux/index.md - Python: - python/index.md - C/C++: