sqlmodel/.github/workflows/deploy-docs.yml

50 lines
1.6 KiB
YAML
Raw Normal View History

name: Deploy Docs
2021-08-24 14:09:22 +00:00
on:
workflow_run:
workflows:
- Build Docs
types:
2021-08-24 14:09:22 +00:00
- completed
jobs:
deploy-docs:
runs-on: ubuntu-latest
2021-08-24 14:09:22 +00:00
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- name: Clean site
run: |
rm -rf ./site
mkdir ./site
2021-08-24 14:09:22 +00:00
- name: Download Artifact Docs
id: download
uses: dawidd6/action-download-artifact@v2.27.0
2021-08-24 14:09:22 +00:00
with:
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 }}
name: docs-site
path: ./site/
2021-08-24 14:09:22 +00:00
- name: Deploy to Netlify
if: steps.download.outputs.found_artifact == 'true'
2021-08-24 14:09:22 +00:00
id: netlify
uses: nwtgck/actions-netlify@v2.0.0
2021-08-24 14:09:22 +00:00
with:
publish-dir: './site'
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
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 }}"