Skip to content

Report published images #223

Report published images

Report published images #223

Workflow file for this run

name: Report published images
on:
push:
branches:
- "master"
paths:
- "build/reports/*.Rmd"
pull_request:
branches:
- "master"
paths:
- "build/reports/*.Rmd"
workflow_run:
workflows:
- "Build & Push Core images"
- "Build & Push extra images"
- "Build & Push experimental images"
branches:
- "master"
types:
- completed
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
generate_matrix:
runs-on: ubuntu-latest
outputs:
matrix-main: ${{ steps.set-matrix.outputs.matrix-main }}
matrix-extra: ${{ steps.set-matrix.outputs.matrix-extra }}
steps:
- uses: actions/[email protected]
- id: set-matrix
run: |
CONTENT_MAIN="$(jq -r 'tostring' build/matrix/all.json)"
CONTENT_EXTRA="$(jq -s -r '.[0] + { group: [.[1].group[] | keys[] | select(. != "default")] } | tostring' build/matrix/latest-two.json build/templates/bakefiles/extra.docker-bake.json)"
echo "matrix-main=${CONTENT_MAIN}" >> "$GITHUB_OUTPUT"
echo "matrix-extra=${CONTENT_EXTRA}" >> "$GITHUB_OUTPUT"
echo "${CONTENT_MAIN}"
inspect-main:
needs: generate_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix-main)}}
steps:
- uses: actions/[email protected]
- name: Clean up
run: |
docker image prune --all --force
- name: Pull images
run: |
BAKE_JSON="bakefiles/${{ matrix.r_version }}.docker-bake.json" \
BAKE_GROUP="${{ matrix.group }}" \
make pull-image-group
- name: Inspect built image
run: |
IMAGELIST_NAME="${{ matrix.r_version }}-${{ matrix.group }}.tsv" \
make inspect-image-all
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: tmp
path: tmp
inspect-extra:
needs: generate_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix-extra)}}
steps:
- uses: actions/checkout@v4
- name: Clean up
run: |
docker image prune --all --force
- name: Pull images
run: |
BAKE_JSON="bakefiles/${{ matrix.r_version }}.extra.docker-bake.json" \
BAKE_GROUP="${{ matrix.group }}" \
make pull-image-group
- name: Inspect built image
run: |
IMAGELIST_NAME="${{ matrix.r_version }}-extra-${{ matrix.group }}.tsv" \
make inspect-image-all
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: tmp
path: tmp
inspect-experimental:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clean up
run: |
docker image prune --all --force
- name: Pull images
run: |
BAKE_JSON="bakefiles/experimental.docker-bake.json" \
BAKE_GROUP="default" \
make pull-image-group
- name: Inspect built image
run: |
IMAGELIST_NAME="experimental.tsv" \
make inspect-image-all
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: tmp
path: tmp
publish_reports:
if: always()
needs:
- inspect-main
- inspect-extra
- inspect-experimental
runs-on: ubuntu-latest
container:
image: rocker/tidyverse:latest
steps:
- name: Checkout main
uses: actions/[email protected]
- name: Set as safe for following git commands
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout wiki
uses: actions/[email protected]
with:
repository: "${{ github.repository }}.wiki"
path: reports
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: tmp
path: tmp
- name: Generate reports and update wiki home
run: |
make --jobs=2 report-all
make --always-make wiki-home
- name: Upload artifacts
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v3
with:
name: reports
path: reports
- name: Update wiki
if: github.event_name != 'pull_request'
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Automated update
repository: reports