Publish Preview #10
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
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 |