From 1a9d0cf72b9030f3d8334ce809d6febf5cbe6024 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20Granstr=C3=B6m?= <5092565+HugoGranstrom@users.noreply.github.com> Date: Wed, 20 Nov 2024 21:55:55 +0100 Subject: [PATCH] let's try this simpler version of CI --- .github/workflows/netlify_deploy_preview.yml | 57 +++++++++++--------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/.github/workflows/netlify_deploy_preview.yml b/.github/workflows/netlify_deploy_preview.yml index 808f2c63..b93e59ee 100644 --- a/.github/workflows/netlify_deploy_preview.yml +++ b/.github/workflows/netlify_deploy_preview.yml @@ -31,33 +31,38 @@ jobs: sha: ${{ steps.source-run-info.outputs.sourceHeadSha }} description: Deploying site to Netlify. Please wait... state: pending - - name: 'Download artifact' - uses: actions/github-script@v3.1.0 - with: - script: | - var artifacts = await github.actions.listWorkflowRunArtifacts({ - owner: context.repo.owner, - repo: context.repo.repo, - run_id: ${{github.event.workflow_run.id }}, - }); - console.log("Target artifact: " + "build-${{ steps.source-run-info.outputs.sourceHeadSha }}") - var matchArtifact = artifacts.data.artifacts.filter((artifact) => { - console.log("Found artifacts: " + artifact.name) - return artifact.name == "build-${{ steps.source-run-info.outputs.sourceHeadSha }}" - })[0]; - if (matchArtifact == undefined) { - core.setFailed('Artifact not found!'); - } - var download = await github.actions.downloadArtifact({ - owner: context.repo.owner, - repo: context.repo.repo, - artifact_id: matchArtifact.id, - archive_format: 'zip', - }); - var fs = require('fs'); - fs.writeFileSync('${{github.workspace}}/docs.zip', Buffer.from(download.data)); - run: rm -rf docs - - run: unzip -d docs/ docs.zip + - name: 'Download artifacts' + uses: actions/download-artifact@v4 + with: + name: "build-${{ steps.source-run-info.outputs.sourceHeadSha }}" + path: docs/ + # - name: 'Download artifact' + # uses: actions/github-script@v3.1.0 + # with: + # script: | + # var artifacts = await github.actions.listWorkflowRunArtifacts({ + # owner: context.repo.owner, + # repo: context.repo.repo, + # run_id: ${{github.event.workflow_run.id }}, + # }); + # console.log("Target artifact: " + "build-${{ steps.source-run-info.outputs.sourceHeadSha }}") + # var matchArtifact = artifacts.data.artifacts.filter((artifact) => { + # console.log("Found artifacts: " + artifact.name) + # return artifact.name == "build-${{ steps.source-run-info.outputs.sourceHeadSha }}" + # })[0]; + # if (matchArtifact == undefined) { + # core.setFailed('Artifact not found!'); + # } + # var download = await github.actions.downloadArtifact({ + # owner: context.repo.owner, + # repo: context.repo.repo, + # artifact_id: matchArtifact.id, + # archive_format: 'zip', + # }); + # var fs = require('fs'); + # fs.writeFileSync('${{github.workspace}}/docs.zip', Buffer.from(download.data)); + #- run: unzip -d docs/ docs.zip - run: echo Deploy Alias = ${{ env.GITHUB_SHA_SHORT }} - uses: jsmrcaga/action-netlify-deploy@master with: