@@ -31,33 +31,45 @@ jobs:
31
31
sha : ${{ steps.source-run-info.outputs.sourceHeadSha }}
32
32
description : Deploying site to Netlify. Please wait...
33
33
state : pending
34
- - name : ' Download artifact'
35
-
36
- with :
37
- script : |
38
- var artifacts = await github.actions.listWorkflowRunArtifacts({
39
- owner: context.repo.owner,
40
- repo: context.repo.repo,
41
- run_id: ${{github.event.workflow_run.id }},
42
- });
43
- console.log("Target artifact: " + "build-${{ steps.source-run-info.outputs.sourceHeadSha }}")
44
- var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
45
- console.log("Found artifacts: " + artifact.name)
46
- return artifact.name == "build-${{ steps.source-run-info.outputs.sourceHeadSha }}"
47
- })[0];
48
- if (matchArtifact == undefined) {
49
- core.setFailed('Artifact not found!');
50
- }
51
- var download = await github.actions.downloadArtifact({
52
- owner: context.repo.owner,
53
- repo: context.repo.repo,
54
- artifact_id: matchArtifact.id,
55
- archive_format: 'zip',
56
- });
57
- var fs = require('fs');
58
- fs.writeFileSync('${{github.workspace}}/docs.zip', Buffer.from(download.data));
59
34
- run : rm -rf docs
60
- - run : unzip -d docs/ docs.zip
35
+ # - name: 'Download artifacts'
36
+ # uses: actions/download-artifact@v4
37
+ # with:
38
+ # name: "build-${{ steps.source-run-info.outputs.sourceHeadSha }}"
39
+ # path: docs/
40
+ - name : ' Download artifacts'
41
+ uses : dawidd6/action-download-artifact@v2
42
+ with :
43
+ github_token : ${{secrets.GITHUB_TOKEN}}
44
+ workflow : netlify_build_docs.yml # Name of the workflow that created the artifact
45
+ name : " build-${{ steps.source-run-info.outputs.sourceHeadSha }}" # Name of the artifact
46
+ path : docs/ # Optional path to extract to
47
+ # - name: 'Download artifact'
48
+
49
+ # with:
50
+ # script: |
51
+ # var artifacts = await github.actions.listWorkflowRunArtifacts({
52
+ # owner: context.repo.owner,
53
+ # repo: context.repo.repo,
54
+ # run_id: ${{github.event.workflow_run.id }},
55
+ # });
56
+ # console.log("Target artifact: " + "build-${{ steps.source-run-info.outputs.sourceHeadSha }}")
57
+ # var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
58
+ # console.log("Found artifacts: " + artifact.name)
59
+ # return artifact.name == "build-${{ steps.source-run-info.outputs.sourceHeadSha }}"
60
+ # })[0];
61
+ # if (matchArtifact == undefined) {
62
+ # core.setFailed('Artifact not found!');
63
+ # }
64
+ # var download = await github.actions.downloadArtifact({
65
+ # owner: context.repo.owner,
66
+ # repo: context.repo.repo,
67
+ # artifact_id: matchArtifact.id,
68
+ # archive_format: 'zip',
69
+ # });
70
+ # var fs = require('fs');
71
+ # fs.writeFileSync('${{github.workspace}}/docs.zip', Buffer.from(download.data));
72
+ # - run: unzip -d docs/ docs.zip
61
73
- run : echo Deploy Alias = ${{ env.GITHUB_SHA_SHORT }}
62
74
- uses : jsmrcaga/action-netlify-deploy@master
63
75
with :
0 commit comments