mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-07-12 17:06:24 +02:00
Delete build environment artifact after builds complete
This commit is contained in:
parent
52442ba1ca
commit
2d94da50dd
1 changed files with 32 additions and 0 deletions
32
.github/workflows/ci.yml
vendored
32
.github/workflows/ci.yml
vendored
|
@ -161,6 +161,38 @@ jobs:
|
||||||
# don't compress again
|
# don't compress again
|
||||||
compression-level: 0
|
compression-level: 0
|
||||||
|
|
||||||
|
cleanup_artifacts:
|
||||||
|
name: Cleanup build environment artifact
|
||||||
|
needs: build_and_package
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Fetch artifact ID
|
||||||
|
id: get-artifact
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
const artifacts = await github.rest.actions.listWorkflowRunArtifacts({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
run_id: ${{ github.run_id }}
|
||||||
|
});
|
||||||
|
const artifact = artifacts.data.artifacts.find(artifact => artifact.name === 'build-environment');
|
||||||
|
if (!artifact) {
|
||||||
|
throw new Error('Artifact build-environment not found');
|
||||||
|
}
|
||||||
|
return artifact.id;
|
||||||
|
|
||||||
|
- name: Delete artifact
|
||||||
|
uses: actions/github-script@v6
|
||||||
|
with:
|
||||||
|
script: |
|
||||||
|
await github.rest.actions.deleteArtifact({
|
||||||
|
owner: context.repo.owner,
|
||||||
|
repo: context.repo.repo,
|
||||||
|
artifact_id: ${{ steps.get-artifact.outputs.result }},
|
||||||
|
archive_format: 'zip'
|
||||||
|
});
|
||||||
|
|
||||||
docker-push:
|
docker-push:
|
||||||
needs: build_and_package
|
needs: build_and_package
|
||||||
name: Publish to Docker Registries
|
name: Publish to Docker Registries
|
||||||
|
|
Loading…
Add table
Reference in a new issue