Report published images #158
This file contains 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: 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" | |
branches: | |
- "master" | |
types: | |
- completed | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: false | |
jobs: | |
generate_matrix: | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: set-matrix | |
run: | | |
CONTENT=$(jq -r '.r_version += ["extra"] | tostring' build/matrix/all.json) | |
echo "matrix=${CONTENT}" >> "$GITHUB_OUTPUT" | |
echo "${CONTENT}" | |
inspect: | |
needs: generate_matrix | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}} | |
steps: | |
- uses: actions/checkout@v4 | |
- 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 | |
publish_reports: | |
if: always() | |
needs: inspect | |
runs-on: ubuntu-latest | |
container: | |
image: rocker/tidyverse:latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v4 | |
- name: Set as safe for following git commands | |
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" | |
- name: Checkout wiki | |
if: github.event_name != 'pull_request' | |
uses: actions/checkout@v4 | |
with: | |
repository: "${{ github.repository }}.wiki" | |
path: reports | |
# - name: clean up image list | |
# run: | |
# rm -rf reports/imagelist | |
- 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@v4 | |
with: | |
commit_message: Automated update | |
repository: reports |