Skip to content

Commit 2945723

Browse files
committed
👷 Add preview docs GitHub Action
1 parent 0e46903 commit 2945723

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.github/workflows/preview-docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Preview Docs
2+
on:
3+
workflow_run:
4+
workflows:
5+
- Build Docs
6+
types:
7+
- completed
8+
9+
jobs:
10+
preview-docs:
11+
runs-on: ubuntu-20.04
12+
steps:
13+
- uses: actions/checkout@v2
14+
- name: Download Artifact Docs
15+
uses: dawidd6/[email protected]
16+
with:
17+
github_token: ${{ secrets.GITHUB_TOKEN }}
18+
workflow: build-docs.yml
19+
run_id: ${{ github.event.workflow_run.id }}
20+
name: docs-zip
21+
- name: Unzip docs
22+
run: |
23+
rm -rf ./site
24+
unzip docs.zip
25+
rm -f docs.zip
26+
- name: Deploy to Netlify
27+
id: netlify
28+
uses: nwtgck/[email protected]
29+
with:
30+
publish-dir: './site'
31+
production-deploy: false
32+
github-token: ${{ secrets.GITHUB_TOKEN }}
33+
enable-commit-comment: false
34+
env:
35+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
36+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
37+
- name: Comment Deploy
38+
uses: ./.github/actions/comment-docs-preview-in-pr
39+
with:
40+
token: ${{ secrets.GITHUB_TOKEN }}
41+
deploy_url: "${{ steps.netlify.outputs.deploy-url }}"

0 commit comments

Comments
 (0)