Split docs build / deploy workflow
This commit is contained in:
parent
2ed1738ee9
commit
7b4405ee35
33
.github/workflows/docs-publish.yml
vendored
33
.github/workflows/docs-publish.yml
vendored
@ -11,8 +11,32 @@ permissions:
|
|||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build
|
||||||
|
if: github.repository == 'benphelps/homepage' && github.event_name == 'pull_request'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: main
|
||||||
|
- uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: 3.x
|
||||||
|
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
key: mkdocs-material-${{ env.cache_id }}
|
||||||
|
path: .cache
|
||||||
|
restore-keys: |
|
||||||
|
mkdocs-material-
|
||||||
|
- run: sudo apt-get install pngquant
|
||||||
|
- run: pip install mike
|
||||||
|
- run: pip install git+https://${GH_TOKEN}@github.com/benphelps/mkdocs-material-insiders.git
|
||||||
|
- name: Docs Test Build
|
||||||
|
run: MKINSIDERS=true mkdocs build
|
||||||
deploy:
|
deploy:
|
||||||
if: github.repository == 'benphelps/homepage'
|
name: Build & Deploy
|
||||||
|
if: github.repository == 'benphelps/homepage' && github.event_name != 'pull_request'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@ -42,13 +66,10 @@ jobs:
|
|||||||
git pull origin gh-pages
|
git pull origin gh-pages
|
||||||
git checkout main
|
git checkout main
|
||||||
- name: Docs Deploy for Main
|
- name: Docs Deploy for Main
|
||||||
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
|
if: github.ref == 'refs/heads/main'
|
||||||
run: MKINSIDERS=true mike deploy --update --push ${{github.ref_name}}
|
run: MKINSIDERS=true mike deploy --update --push ${{github.ref_name}}
|
||||||
- name: Docs Deploy for Tags
|
- name: Docs Deploy for Tags
|
||||||
if: github.event_name != 'pull_request' && github.ref != 'refs/heads/main'
|
if: github.ref != 'refs/heads/main'
|
||||||
run: MKINSIDERS=true mike deploy --update --push ${{github.ref_name}} latest
|
run: MKINSIDERS=true mike deploy --update --push ${{github.ref_name}} latest
|
||||||
- name: Docs Test Build
|
|
||||||
if: github.event_name == 'pull_request'
|
|
||||||
run: MKINSIDERS=true mkdocs build
|
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user