@@ -35,33 +35,14 @@ jobs:
35
35
description : Deploying site to Netlify. Please wait...
36
36
state : pending
37
37
38
- - name : ' Download artifact'
39
-
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));
63
38
- 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/
65
46
66
47
- run : echo Deploy Alias = ${{ env.GITHUB_SHA_SHORT }}
67
48
- uses : jsmrcaga/action-netlify-deploy@master
0 commit comments