Skip to content

Publish PR preview #138

Publish PR preview

Publish PR preview #138

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 }}