mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-05 21:47:48 +01:00
Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
79 lines
2.3 KiB
YAML
79 lines
2.3 KiB
YAML
name: Docs
|
|
|
|
on:
|
|
push:
|
|
tags: ["v*.*.*"]
|
|
branches: ["main"]
|
|
pull_request:
|
|
merge_group:
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
pre-commit:
|
|
name: Linting Checks
|
|
runs-on: ubuntu-22.04
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
- name: Install python
|
|
uses: actions/setup-python@v6
|
|
with:
|
|
python-version: 3.x
|
|
- name: Check files
|
|
uses: pre-commit/action@v3.0.1
|
|
|
|
test:
|
|
name: Test Build Docs
|
|
if: github.repository == 'gethomepage/homepage' && github.event_name == 'pull_request'
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- pre-commit
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: actions/setup-python@v6
|
|
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-get install pngquant
|
|
- run: pip install mkdocs-material mkdocs-redirects "mkdocs-material[imaging]"
|
|
- name: Test Docs Build
|
|
run: MKINSIDERS=false mkdocs build
|
|
deploy:
|
|
name: Build & Deploy Docs
|
|
if: github.repository == 'gethomepage/homepage' && github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- pre-commit
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- 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@v6
|
|
with:
|
|
python-version: 3.x
|
|
- run: echo "cache_id=${{github.sha}}" >> $GITHUB_ENV
|
|
- uses: actions/cache@v4
|
|
with:
|
|
key: mkdocs-material-${{ env.cache_id }}
|
|
path: .cache
|
|
restore-keys: |
|
|
mkdocs-material-
|
|
- run: sudo apt-get install pngquant
|
|
- run: pip install git+https://${GH_TOKEN}@github.com/benphelps/mkdocs-material-insiders.git
|
|
- run: pip install mkdocs-redirects "mkdocs-material[imaging]"
|
|
- name: Docs Deploy
|
|
run: MKINSIDERS=true mkdocs gh-deploy --force
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|