2023-07-31 15:15:43 +00:00
|
|
|
name: Deploy Docs
|
2021-08-24 14:09:22 +00:00
|
|
|
on:
|
|
|
|
workflow_run:
|
|
|
|
workflows:
|
|
|
|
- Build Docs
|
2023-07-31 15:15:43 +00:00
|
|
|
types:
|
2021-08-24 14:09:22 +00:00
|
|
|
- completed
|
|
|
|
|
|
|
|
jobs:
|
2023-07-31 15:15:43 +00:00
|
|
|
deploy-docs:
|
|
|
|
runs-on: ubuntu-latest
|
2021-08-24 14:09:22 +00:00
|
|
|
steps:
|
2023-07-31 15:15:43 +00:00
|
|
|
- name: Dump GitHub context
|
|
|
|
env:
|
|
|
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
|
|
run: echo "$GITHUB_CONTEXT"
|
|
|
|
- uses: actions/checkout@v3
|
2022-12-16 18:45:51 +00:00
|
|
|
- name: Clean site
|
|
|
|
run: |
|
|
|
|
rm -rf ./site
|
|
|
|
mkdir ./site
|
2021-08-24 14:09:22 +00:00
|
|
|
- name: Download Artifact Docs
|
2023-07-31 15:15:43 +00:00
|
|
|
id: download
|
|
|
|
uses: dawidd6/action-download-artifact@v2.27.0
|
2021-08-24 14:09:22 +00:00
|
|
|
with:
|
2023-07-31 15:15:43 +00:00
|
|
|
if_no_artifact_found: ignore
|
2021-08-24 14:09:22 +00:00
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
workflow: build-docs.yml
|
|
|
|
run_id: ${{ github.event.workflow_run.id }}
|
2023-07-31 15:15:43 +00:00
|
|
|
name: docs-site
|
2022-12-16 18:45:51 +00:00
|
|
|
path: ./site/
|
2021-08-24 14:09:22 +00:00
|
|
|
- name: Deploy to Netlify
|
2023-07-31 15:15:43 +00:00
|
|
|
if: steps.download.outputs.found_artifact == 'true'
|
2021-08-24 14:09:22 +00:00
|
|
|
id: netlify
|
2023-07-31 15:15:43 +00:00
|
|
|
uses: nwtgck/actions-netlify@v2.0.0
|
2021-08-24 14:09:22 +00:00
|
|
|
with:
|
|
|
|
publish-dir: './site'
|
2023-07-31 15:15:43 +00:00
|
|
|
production-deploy: ${{ github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'main' }}
|
2021-08-24 14:09:22 +00:00
|
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
enable-commit-comment: false
|
|
|
|
env:
|
|
|
|
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
|
|
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
|
|
|
|
- name: Comment Deploy
|
2023-07-31 15:15:43 +00:00
|
|
|
if: steps.netlify.outputs.deploy-url != ''
|
2021-08-24 14:09:22 +00:00
|
|
|
uses: ./.github/actions/comment-docs-preview-in-pr
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
deploy_url: "${{ steps.netlify.outputs.deploy-url }}"
|