[FIX] add push triger to main branch of doc building #1
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: MkDocs Build | |
on: | |
push: | |
branches: [main, develop] | |
pull_request: | |
branches: [main, develop] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Conda | |
uses: conda-incubator/setup-miniconda@v3 | |
with: | |
activate-environment: pyrosys | |
auto-activate-base: false | |
- name: Setup Environment | |
shell: bash -el {0} | |
env: | |
WORKSPACE: ${{ github.workspace }} | |
run: | | |
.ci/autosetup.sh | |
- name: Build Docs | |
run: | | |
mkdocs build | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: site | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
# Add permissions for pages | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |