mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Truncate Docker image artifact at end of Docker CI workflow
In the (private) zeek-security repo we currently hit the 2GB storage limit whenever CI runs happen multiple times in one day, because our Docker Github workflow preserves the output of the first job (the image build) for the second job (the cluster tests). For successful runs, there's no need for the Docker image to survive the CI run. (For failures, it might help to grab the image for local testing.) There's no Github-official way to delete an attachment within a workflow, so this simply truncates the artifact if the workflow succeeds.
This commit is contained in:
parent
bd1190bfeb
commit
c150f7805b
1 changed files with 13 additions and 0 deletions
13
.github/workflows/docker.yml
vendored
13
.github/workflows/docker.yml
vendored
|
@ -168,3 +168,16 @@ jobs:
|
||||||
name: cluster-btest
|
name: cluster-btest
|
||||||
path: testing/external/zeek-testing-cluster/.tmp
|
path: testing/external/zeek-testing-cluster/.tmp
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
|
|
||||||
|
# To save storage space, truncate the Docker image artifact
|
||||||
|
# when this run was successful.
|
||||||
|
- name: Truncate Docker image
|
||||||
|
run: |
|
||||||
|
truncate -s0 ${{ env.IMAGE_FILE }}
|
||||||
|
|
||||||
|
- name: Store truncated image artifact
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: ${{ env.IMAGE_NAME }}
|
||||||
|
path: ${{ env.IMAGE_FILE }}
|
||||||
|
retention-days: 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue