ci: limit keeping artifacts for PRs (#16976)
This commit is contained in:
parent
ab250cf232
commit
b2b6449be7
|
@ -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:
|
||||
|
|
|
@ -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 }}
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue