diff --git a/.github/workflows/build_docs.yml b/.github/workflows/build_docs.yml index 123ffcc..6d1d228 100644 --- a/.github/workflows/build_docs.yml +++ b/.github/workflows/build_docs.yml @@ -1,28 +1,18 @@ -# This is a basic workflow to help you get started with Actions +name: Build and Deploy Documentation -name: CI - -# Controls when the action will run. on: - # Triggers the workflow on push or pull request events but only for the master branch push: branches: [ master ] pull_request: branches: [ master ] - # Allows you to run this workflow manually from the Actions tab workflow_dispatch: -# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - # This workflow contains a single job called "build" - build: - # The type of runner that the job will run on + build-and-deploy-docs: runs-on: ubuntu-latest - # Steps represent a sequence of tasks that will be executed as part of the job steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 # Builds the documentation website under ./build/html @@ -32,7 +22,10 @@ jobs: ./build_docs.sh # Deploys the website to the gh-pages branch - - name: Deploy + - name: Deploy to GitHub Pages + # Trigger on push to the default branch (usually 'master' or 'main') + # as well as if triggered manually with a workspace dispatch event. + if: ${{ github.ref_name == github.event.repository.default_branch && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }} uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }}