diff --git a/.github/workflows/publish_docs.yml b/.github/workflows/publish_docs.yml index d59a3cb..c446cd1 100644 --- a/.github/workflows/publish_docs.yml +++ b/.github/workflows/publish_docs.yml @@ -3,13 +3,16 @@ on: push: branches: - master + paths: + - '**.md' + - '.github/workflow/publish*' workflow_dispatch: permissions: pages: 'write' id-token: 'write' jobs: - build: - name: "Build Docs" + build-and-deploy: + name: "Build and Deploy Docs" runs-on: 'ubuntu-latest' steps: - uses: 'actions/checkout@v4' @@ -18,18 +21,11 @@ jobs: with: src: 'docs' dst: 'generated-pages' - - name: 'Upload artifact' - uses: 'actions/upload-pages-artifact@v3' + - name: 'Install rsync' + run: 'apt-get update && apt-get install -y rsync' + - name: 'Deploy Docs' + uses: JamesIves/github-pages-deploy-action@v4 with: - path: 'generated-pages' - deploy: - name: "Deploy Docs" - environment: - name: 'github-pages' - url: '${{ steps.deployment.outputs.page_url }}' - runs-on: 'ubuntu-latest' - needs: 'build' - steps: - - name: 'Deploy to GitHub Pages' - id: 'deployment' - uses: 'actions/deploy-pages@v4' + folder: generated-pages + force: false + clean-exclude: pr-preview/ diff --git a/.github/workflows/publish_docs_preview_branch.yml b/.github/workflows/publish_docs_preview_branch.yml deleted file mode 100644 index dd62013..0000000 --- a/.github/workflows/publish_docs_preview_branch.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: 'Publish Preview of Docs Site from branch' -# The publish_docs_preview.yml workflow takes a PR and publishes the results to it's own branch -# so users can preview it. But that git branch then needs some way to publish, so this action does that. -on: - push: - branch: - - gh-pages -permissions: - pages: 'write' - id-token: 'write' -jobs: - stage: - name: "Stage PR preview from branch to pages" - runs-on: 'ubuntu-latest' - steps: - - uses: 'actions/checkout@v4' - with: - ref: 'refs/heads/gh-pages' - - name: 'Upload artifact' - uses: 'actions/upload-pages-artifact@v3' - with: - path: '.' - deploy: - name: "Deploy PR Preview from branch to pages" - needs: 'stage' - environment: - name: 'gh-pages-pr-preview' - url: '${{ steps.deployment.outputs.page_url }}' - runs-on: 'ubuntu-latest' - steps: - - name: 'Deploy to GitHub Pages' - id: 'deployment' - uses: 'actions/deploy-pages@v4'