Skip to content

Commit

Permalink
In fly-deploy, delete artifact after it's used
Browse files Browse the repository at this point in the history
  • Loading branch information
dsagal committed Nov 28, 2024
1 parent a1ae364 commit b156f98
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/fly-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,25 @@ jobs:
uses: actions/github-script@v7
with:
script: |
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
var repo = {
owner: context.repo.owner,
repo: context.repo.repo,
};
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({...repo,
run_id: ${{ github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "docker-image"
})[0];
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
var download = await github.rest.actions.downloadArtifact({...repo,
artifact_id: matchArtifact.id,
archive_format: 'zip',
});
var fs = require('fs');
fs.writeFileSync('${{github.workspace}}/docker-image.zip', Buffer.from(download.data));
await github.rest.actions.deleteArtifact({...repo,
artifact_id: matchArtifact.id,
});
- name: Extract artifacts
id: extract_artifacts
run: |
Expand Down

0 comments on commit b156f98

Please sign in to comment.