Skip to content

Commit

Permalink
update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
HugoGranstrom committed Nov 21, 2024
1 parent ea1044a commit 47d784f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
33 changes: 7 additions & 26 deletions .github/workflows/pr_preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,33 +35,14 @@ jobs:
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: dawidd6/action-download-artifact@v2
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: netlify_build_docs.yml # Name of the workflow that created the artifact
name: "build-${{ steps.source-run-info.outputs.sourceHeadSha }}" # Name of the artifact
path: docs/

- run: echo Deploy Alias = ${{ env.GITHUB_SHA_SHORT }}
- uses: jsmrcaga/action-netlify-deploy@master
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/valid.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: GenBook
run: nimble genbook
- run: echo Commit hash = ${{ github.event.pull_request.head.sha }}
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: build-${{ github.event.pull_request.head.sha }}
path: docs/
Expand Down

0 comments on commit 47d784f

Please sign in to comment.