Skip to content

Commit

Permalink
let's try this simpler version of CI
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoGranstrom committed Nov 20, 2024
1 parent f72a637 commit 1a9d0cf
Showing 1 changed file with 31 additions and 26 deletions.
57 changes: 31 additions & 26 deletions .github/workflows/netlify_deploy_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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/[email protected]
# 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:
Expand Down

0 comments on commit 1a9d0cf

Please sign in to comment.