docs-pr-netlify.yaml 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. name: Deploy documentation PR preview
  2. on:
  3. workflow_run:
  4. workflows: [ "Prepare documentation PR preview" ]
  5. types:
  6. - completed
  7. jobs:
  8. netlify:
  9. if: github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'pull_request'
  10. runs-on: ubuntu-latest
  11. steps:
  12. # There's a 'download artifact' action, but it hasn't been updated for the workflow_run action
  13. # (https://github.com/actions/download-artifact/issues/60) so instead we get this mess:
  14. - name: 📥 Download artifact
  15. uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e # v2.28.0
  16. with:
  17. workflow: docs-pr.yaml
  18. run_id: ${{ github.event.workflow_run.id }}
  19. name: book
  20. path: book
  21. - name: 📤 Deploy to Netlify
  22. uses: matrix-org/netlify-pr-preview@v3
  23. with:
  24. path: book
  25. owner: ${{ github.event.workflow_run.head_repository.owner.login }}
  26. branch: ${{ github.event.workflow_run.head_branch }}
  27. revision: ${{ github.event.workflow_run.head_sha }}
  28. token: ${{ secrets.NETLIFY_AUTH_TOKEN }}
  29. site_id: ${{ secrets.NETLIFY_SITE_ID }}
  30. desc: Documentation preview
  31. deployment_env: PR Documentation Preview