Skip to content

Commit

Permalink
Merge pull request #2163 from SEKOIA-IO/gha/fix-upload
Browse files Browse the repository at this point in the history
ci: Move away from `upload-artifact@v3`
  • Loading branch information
otetard authored Jan 16, 2025
2 parents 7cd79a5 + d091421 commit 3d6f605
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 40 deletions.
23 changes: 4 additions & 19 deletions .github/workflows/delete-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Download artifact
uses: actions/[email protected]
- uses: actions/download-artifact@v4
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "PR"
})[0];
var download = await github.rest.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}}/PR.zip', Buffer.from(download.data));
name: PR
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- run: unzip PR.zip

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preview-cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
mkdir PR
echo ${{ github.event.number }} > ./PR/PR_NUMBER
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: PR
path: PR/
2 changes: 1 addition & 1 deletion .github/workflows/preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- run: |
tar zcvf site.tar.gz -C site .
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
name: site.tar.gz
path: site.tar.gz
23 changes: 4 additions & 19 deletions .github/workflows/upload-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,11 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Download artifact
uses: actions/[email protected]
- uses: actions/download-artifact@v4
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "site.tar.gz"
})[0];
var download = await github.rest.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}}/site.tar.gz.zip', Buffer.from(download.data));
name: site.tar.gz
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}

- run: |
unzip site.tar.gz.zip
Expand Down

0 comments on commit 3d6f605

Please sign in to comment.