Documentation (Deploy) #28
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: "Documentation (Deploy)" | |
# see https://securitylab.github.com/research/github-actions-preventing-pwn-requests/ | |
on: | |
workflow_run: | |
workflows: ["Documentation (Generate)"] | |
types: | |
- completed | |
# see https://github.com/JamesIves/github-pages-deploy-action/tree/dev | |
permissions: | |
contents: write | |
jobs: | |
deploy-coverage: | |
name: "Info: Documentation" | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set shas | |
id: sha | |
uses: actions/github-script@v6 | |
with: | |
result-encoding: string | |
script: | | |
const {data: callee_run } = await github.rest.actions.getWorkflowRun({ | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
run_id: context.payload.workflow_run.id, | |
}); | |
console.log(callee_run); | |
// from manual inspection in jq, seems to hold head.sha for PR, not | |
// whatever GITHUB_SHA is. | |
return callee_run.head_sha; | |
- name: Download artifact | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
name: docs-${{ steps.sha.outputs.result }} | |
workflow: docs-generate.yml | |
path: ./deploy | |
- name: Deploy to Github Pages | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: ./deploy | |
target-folder: "docs" | |
branch: gh-pages | |
commit-message: "Actions: Documentation for ${{ steps.sha.outputs.result }}" |