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
|
- uses: actions/checkout@v3
|
||||||
- run: |
|
- run: |
|
||||||
mkdir dist && touch dist/.placeholder
|
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
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifact-name }}
|
name: ${{ inputs.artifact-name }}
|
||||||
path: dist
|
path: dist
|
||||||
|
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
|
||||||
|
|
||||||
|
|
||||||
build-packages:
|
build-packages:
|
||||||
|
|
|
@ -100,11 +100,16 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
bash generate_checkpoints.sh ${{ inputs.pl_version }}
|
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
|
- name: Upload checkpoints to GitHub Actions artifact
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: checkpoints-${{ github.sha }}
|
name: checkpoints-${{ github.sha }}
|
||||||
path: ${{ env.legacy_dir }}/checkpoints/
|
path: ${{ env.legacy_dir }}/checkpoints/
|
||||||
|
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
|
||||||
|
|
||||||
- name: Upload checkpoints to S3 (dryrun)
|
- name: Upload checkpoints to S3 (dryrun)
|
||||||
working-directory: ${{ env.legacy_dir }}
|
working-directory: ${{ env.legacy_dir }}
|
||||||
|
|
|
@ -127,11 +127,16 @@ jobs:
|
||||||
run: make linkcheck
|
run: make linkcheck
|
||||||
continue-on-error: true
|
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
|
- name: Upload built docs
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
|
name: docs-${{ matrix.pkg-name }}-${{ github.sha }}
|
||||||
path: docs/build/html/
|
path: docs/build/html/
|
||||||
|
retention-days: ${{ steps.keep-artifact.outputs.DAYS }}
|
||||||
|
|
||||||
|
|
||||||
deploy-docs:
|
deploy-docs:
|
||||||
|
|
Loading…
Reference in New Issue