Skip to content

Commit cf36b2d

Browse files
authored
👷 Refactor CI artifact upload/download for docs previews (#514)
1 parent 5fa9062 commit cf36b2d

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.github/workflows/build-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
- uses: actions/upload-artifact@v3
6969
with:
7070
name: docs-zip
71-
path: ./docs.zip
71+
path: ./site/docs.zip
7272
- name: Deploy to Netlify
7373
uses: nwtgck/[email protected]
7474
with:

.github/workflows/preview-docs.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,21 @@ jobs:
1111
runs-on: ubuntu-20.04
1212
steps:
1313
- uses: actions/[email protected]
14+
- name: Clean site
15+
run: |
16+
rm -rf ./site
17+
mkdir ./site
1418
- name: Download Artifact Docs
1519
uses: dawidd6/[email protected]
1620
with:
1721
github_token: ${{ secrets.GITHUB_TOKEN }}
1822
workflow: build-docs.yml
1923
run_id: ${{ github.event.workflow_run.id }}
2024
name: docs-zip
25+
path: ./site/
2126
- name: Unzip docs
2227
run: |
23-
rm -rf ./site
28+
cd ./site
2429
unzip docs.zip
2530
rm -f docs.zip
2631
- name: Deploy to Netlify

scripts/zip-docs.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
set -x
44
set -e
55

6+
cd ./site
7+
68
if [ -f docs.zip ]; then
79
rm -rf docs.zip
810
fi
9-
zip -r docs.zip ./site
11+
zip -r docs.zip ./

0 commit comments

Comments
 (0)