ci: limit keeping artifacts for PRs (#16976)

This commit is contained in:
Jirka Borovec 2023-03-07 01:33:29 +01:00 committed by GitHub
parent ab250cf232
commit b2b6449be7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View File

@ -26,10 +26,14 @@ jobs:
- uses: actions/checkout@v3
- run: |
mkdir dist && touch dist/.placeholder
- name: Keep artifact
id: keep-artifact
run: python -c "print('DAYS=' + str(5 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
with:
name: ${{ inputs.artifact-name }}
path: dist
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
build-packages:

View File

@ -100,11 +100,16 @@ jobs:
run: |
bash generate_checkpoints.sh ${{ inputs.pl_version }}
- name: Keep artifact
id: keep-artifact
run: python -c "print('DAYS=' + str(30 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
- name: Upload checkpoints to GitHub Actions artifact
uses: actions/upload-artifact@v3
with:
name: checkpoints-${{ github.sha }}
path: ${{ env.legacy_dir }}/checkpoints/
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
- name: Upload checkpoints to S3 (dryrun)
working-directory: ${{ env.legacy_dir }}

View File

@ -127,11 +127,16 @@ jobs:
run: make linkcheck
continue-on-error: true
- name: Keep artifact
id: keep-artifact
run: python -c "print('DAYS=' + str(7 if '${{ github.event_name }}'.startswith('pull_request') else 0))" >> $GITHUB_OUTPUT
- name: Upload built docs
uses: actions/upload-artifact@v3
with:
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
path: docs/build/html/
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
deploy-docs: