Skip to content

Update github-actions to v10 #5115

Update github-actions to v10

Update github-actions to v10 #5115

---
"name": "Build Notebooks (push)"
"on":
"push":
"paths-ignore":
# Don't build images if the only thing that changed is image digests in manifests
- manifests/base/params-latest.env
- manifests/base/params.env
# In fact, skip the build if there are only changes in manifests and nowhere else
- manifests/**
"workflow_dispatch":
inputs:
"odh":
description: "Build Dockerfile.*"
type: boolean
default: false
"rhds":
description: "Build Dockerfile.konflux.* (requires subscription)"
type: boolean
default: false
"schedule":
- "cron": "0 2 * * *"
permissions:
contents: read
packages: write
jobs:
gen:
name: Generate job matrix
permissions:
contents: read
packages: read
runs-on: ubuntu-26.04
# for odh-io/notebooks and rhds/notebooks, allow only main, rhoai-*, release-*
if: ${{ github.event_name == 'workflow_dispatch' ||
(github.repository != 'opendatahub-io/notebooks' && github.repository != 'red-hat-data-services/notebooks')
|| github.ref_name == 'main' || github.ref_name == '2024b' || github.ref_name == '2024a'
|| startsWith(github.ref_name, 'rhoai-') || startsWith(github.ref_name, 'release-') }}
outputs:
matrix: ${{ steps.gen.outputs.matrix }}
has_jobs: ${{ steps.gen.outputs.has_jobs }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Login to GitHub Container Registry
if: ${{ github.repository != 'opendatahub-io/notebooks' }}
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine targets to build (we want to build everything on push)
run: |
set -x
python3 ci/cached-builds/gen_gha_matrix_jobs.py \
--s390x-images include
id: gen
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
build:
name: "${{ matrix.target }} · ${{ matrix.platform }}"
needs: ["gen"]
strategy:
fail-fast: false
matrix: "${{ fromJson(needs.gen.outputs.matrix) }}"
uses: ./.github/workflows/build-notebooks-TEMPLATE.yaml
if: ${{ (inputs.odh || (github.event_name != 'workflow_dispatch' && github.repository != 'red-hat-data-services/notebooks')) && fromJson(needs.gen.outputs.has_jobs) }}
with:
target: "${{ matrix.target }}"
python: "${{ matrix.python }}"
github: "${{ toJSON(github) }}"
platform: "${{ matrix.platform }}"
subscription: "${{ matrix.subscription }}"
secrets: inherit
build-aipcc:
name: "${{ matrix.target }} · ${{ matrix.platform }}"
needs: ["gen"]
strategy:
fail-fast: false
matrix: "${{ fromJson(needs.gen.outputs.matrix) }}"
uses: ./.github/workflows/build-notebooks-TEMPLATE.yaml
if: ${{ (inputs.rhds || (github.event_name != 'workflow_dispatch' && github.repository == 'red-hat-data-services/notebooks')) && fromJson(needs.gen.outputs.has_jobs) }}
with:
target: "${{ matrix.target }}"
python: "${{ matrix.python }}"
github: "${{ toJSON(github) }}"
platform: "${{ matrix.platform }}"
# rhds/notebooks builds from AIPCC base images that are RHEL-based
subscription: ${{ true }}
product: rhoai
secrets: inherit