Publish PR preview #211
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: | |
name: Publish PR preview | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- name: Download HTML artifact | |
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4 | |
with: | |
name: website-html | |
path: dist | |
run_id: ${{ github.event.workflow_run.id }} | |
- name: Download Functions artifact | |
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4 | |
with: | |
name: website-functions | |
path: functions | |
run_id: ${{ github.event.workflow_run.id }} | |
- name: Download package artifact | |
uses: dawidd6/action-download-artifact@09f2f74827fd3a8607589e5ad7f9398816f540fe # v3.1.4 | |
with: | |
name: website-package | |
run_id: ${{ github.event.workflow_run.id }} | |
# TODO this action is deprecated! | |
- name: Gather PR details | |
uses: potiuk/get-workflow-origin@08219db9dbbbec802d571eaf0e14ece0bc005f72 # v1_6 | |
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: quiltmc-org | |
directory: dist | |
branch: preview-${{ steps.pr-details.outputs.pullRequestNumber }} |