Session Images #42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Session Images | |
| on: | |
| schedule: | |
| # Weekly rebuild of all images, to pick up any upstream changes. | |
| - cron: "15 4 * * 0" # At 04:15 on Sunday | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| # Only cancel in-progress runs for pull_request events, this prevents cancelling workflows against main or tags | |
| # A pull_request will reuse the same group thus enabling cancelation, all others receive a unique run_id | |
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| build: | |
| name: Build | |
| # Build all images, excluding dev versions. | |
| # | |
| # Builds all versions of each image in parallel. | |
| # | |
| # Run on merges to main, or on weekly scheduled re-builds. | |
| if: contains(fromJSON('["push", "pull_request"]'), github.event_name) || github.event.schedule == '15 3 * * 0' | |
| permissions: | |
| contents: read | |
| packages: write | |
| uses: "posit-dev/images-shared/.github/workflows/bakery-build.yml@main" | |
| secrets: | |
| DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| with: | |
| runs-on: ubuntu-latest-4x | |
| matrix-versions: only | |
| # Push images only for merges into main and weekly schduled re-builds. | |
| push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' || github.event.schedule == '15 3 * * 0' }} | |
| clean: | |
| name: Clean | |
| if: always() && github.ref == 'refs/heads/main' | |
| permissions: | |
| contents: read | |
| packages: write | |
| needs: | |
| - build | |
| uses: "posit-dev/images-shared/.github/workflows/clean.yml@main" | |
| with: | |
| remove-dangling-caches: true | |
| remove-caches-older-than: 14 | |
| # FIXME: re-enable temporary image cleanup after moving to native platform workflow | |
| # remove-dangling-temporary-images: false | |
| # remove-temporary-images-older-than: 3 | |
| clean-temporary-images: false |