Publish PR preview #191
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
on: | |
workflow_run: | |
workflows: ["PR preview"] | |
types: [completed] | |
name: Publish PR preview | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
name: Publish PR preview | |
steps: | |
- name: Download HTML artifact | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
name: website-html | |
path: build | |
run_id: ${{ github.event.workflow_run.id }} | |
- name: Gather PR details | |
uses: potiuk/get-workflow-origin@v1_1 | |
id: pr-details | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
sourceRunId: ${{ github.event.workflow_run.id }} | |
- name: Publish to Pages | |
uses: cloudflare/pages-action@1 | |
with: | |
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
projectName: developer-wiki | |
directory: build | |
branch: preview-${{ steps.pr-details.outputs.pullRequestNumber }} |