mirror of https://github.com/0xERR0R/blocky.git
ci: deploy docs on forks if they have pages enabled
This commit is contained in:
parent
8a93e4500c
commit
2bd59484c0
|
@ -2,32 +2,34 @@ name: docs
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- '**'
|
||||
tags:
|
||||
- v*
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == '0xERR0R'
|
||||
if: ${{ github.event.repository.has_pages && (github.repository_owner != '0xERR0R' || github.ref_type == 'tag' || github.ref_name == 'main') }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.x
|
||||
|
||||
|
||||
- name: install tools
|
||||
run: pip install mkdocs-material mike
|
||||
|
||||
|
||||
- name: Setup doc deploy
|
||||
run: |
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
|
||||
- name: Deploy version for tag/branch
|
||||
run: mike deploy --push --update-aliases ${GITHUB_REF_NAME}
|
||||
- name: Deploy latest version for tag only
|
||||
if: ${{ github.ref != 'refs/heads/main' }}
|
||||
run: mike deploy --push --update-aliases ${GITHUB_REF_NAME} latest
|
||||
- run: mike set-default --push latest
|
||||
- name: Deploy version for branch
|
||||
if: ${{ startsWith(github.ref, 'refs/heads/') }}
|
||||
run: mike deploy --push --update-aliases "$(sed 's:/:-:g' <<< "${GITHUB_REF_NAME}")"
|
||||
|
||||
- name: Deploy version for tag and update latest
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
run: mike deploy --push --update-aliases "${GITHUB_REF_NAME}" latest
|
||||
|
|
Loading…
Reference in New Issue