Skip to content

Commit 9abfc3a

Browse files
update CI (#57)
1 parent ea1044a commit 9abfc3a

File tree

2 files changed

+8
-27
lines changed

2 files changed

+8
-27
lines changed

.github/workflows/pr_preview.yml

+7-26
Original file line numberDiff line numberDiff line change
@@ -35,33 +35,14 @@ jobs:
3535
description: Deploying site to Netlify. Please wait...
3636
state: pending
3737

38-
- name: 'Download artifact'
39-
uses: actions/[email protected]
40-
with:
41-
script: |
42-
var artifacts = await github.actions.listWorkflowRunArtifacts({
43-
owner: context.repo.owner,
44-
repo: context.repo.repo,
45-
run_id: ${{github.event.workflow_run.id }},
46-
});
47-
console.log("Target artifact: " + "build-${{ steps.source-run-info.outputs.sourceHeadSha }}")
48-
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
49-
console.log("Found artifacts: " + artifact.name)
50-
return artifact.name == "build-${{ steps.source-run-info.outputs.sourceHeadSha }}"
51-
})[0];
52-
if (matchArtifact == undefined) {
53-
core.setFailed('Artifact not found!');
54-
}
55-
var download = await github.actions.downloadArtifact({
56-
owner: context.repo.owner,
57-
repo: context.repo.repo,
58-
artifact_id: matchArtifact.id,
59-
archive_format: 'zip',
60-
});
61-
var fs = require('fs');
62-
fs.writeFileSync('${{github.workspace}}/docs.zip', Buffer.from(download.data));
6338
- run: rm -rf docs
64-
- run: unzip -d docs/ docs.zip
39+
- name: 'Download artifacts'
40+
uses: dawidd6/action-download-artifact@v2
41+
with:
42+
github_token: ${{secrets.GITHUB_TOKEN}}
43+
workflow: netlify_build_docs.yml # Name of the workflow that created the artifact
44+
name: "build-${{ steps.source-run-info.outputs.sourceHeadSha }}" # Name of the artifact
45+
path: docs/
6546

6647
- run: echo Deploy Alias = ${{ env.GITHUB_SHA_SHORT }}
6748
- uses: jsmrcaga/action-netlify-deploy@master

.github/workflows/valid.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: GenBook
1919
run: nimble genbook
2020
- run: echo Commit hash = ${{ github.event.pull_request.head.sha }}
21-
- uses: actions/upload-artifact@v2
21+
- uses: actions/upload-artifact@v4
2222
with:
2323
name: build-${{ github.event.pull_request.head.sha }}
2424
path: docs/

0 commit comments

Comments
 (0)