Skip to content

Publish Preview

Publish Preview #10

Workflow file for this run

name: Publish Preview
on:
workflow_dispatch:
inputs:
pr_num:
description: "PR number"
type: number
required: true
permissions:
contents: read
jobs:
publish:
name: Publish preview to GitHub Pages
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@master
with:
ref: gh-pages
- name: Update GitHub Pages
env:
GH_TOKEN: ${{ github.token }}
run: |
git config user.name "Preview Deploy"
git config user.email ""
rm -rf pr-${{ inputs.pr_num }}
mkdir pr-${{ inputs.pr_num }}
gh run download --name preview-${{ inputs.pr_num }} --dir pr-${{ inputs.pr_num }}
git add -A
git commit -m 'Preview pr-${{ inputs.pr_num }}'
git push origin +gh-pages