diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 9f5a6f7..8f74927 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -1,28 +1,28 @@ name: Docs - on: - workflow_dispatch: - push: + pull_request: branches: - - master - main - pull_request: + types: + - closed jobs: publish: + if: github.event.pull_request.merged runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v1 - - name: Build - id: build + - name: Checkout Repository + uses: actions/checkout@v3 + + - name: Build Documentation uses: ResearchSoftwareActions/ford-build@v1.0 - - name: Deploy - if: success() + id: build + + - name: Deploy to GitHub Pages + if: steps.build.outcome == 'success' uses: crazy-max/ghaction-github-pages@v4 with: target_branch: gh-pages build_dir: doc env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} -