chore(deps): bump the gh-actions group across 1 directory with 16 upd… #361
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: Build global base images | |
| on: | |
| push: | |
| paths: | |
| - "global-images/**" | |
| - ".github/workflows/build-global-renkulab-images.yml" | |
| branches: | |
| - "**" | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| env: | |
| DOCKER_PREFIX: ghcr.io/swissdatasciencecenter/renku | |
| RUN_IMAGE_AMD64: ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/run-image:0.6.0 | |
| BUILDER_IMAGE_AMD64: ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/selector:0.6.0 | |
| RUN_IMAGE_ARM64: ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/cuda-run-image:0.6.0 | |
| BUILDER_IMAGE_ARM64: ghcr.io/swissdatasciencecenter/renku-frontend-buildpacks/cuda-selector:0.6.0 | |
| jobs: | |
| build-images: | |
| runs-on: ${{ matrix.PLATFORM == 'linux/arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| PLATFORM: | |
| - linux/amd64 | |
| - linux/arm64 | |
| FLAVOR: | |
| - basic | |
| - datascience | |
| FRONTEND: | |
| - jupyterlab | |
| - vscodium | |
| - ttyd | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.DOCKER_PREFIX }}/py-${{ matrix.FLAVOR }}-${{ matrix.FRONTEND }} | |
| tags: | | |
| type=sha,prefix=${{ matrix.PLATFORM == 'linux/arm64' && 'arm64' || 'amd64' }}- | |
| - name: Docker meta cache | |
| id: meta_cache | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.DOCKER_PREFIX }}/py-${{ matrix.FLAVOR }}-${{ matrix.FRONTEND }}-cache | |
| tags: | | |
| type=raw,value=${{ matrix.PLATFORM == 'linux/arm64' && 'arm64' || 'amd64' }} | |
| - name: Setup pack | |
| uses: buildpacks/github-actions/setup-pack@v5.12.3 | |
| - name: Build image | |
| working-directory: ./global-images | |
| run: | | |
| BUILD_TAG=$(echo '${{ steps.meta.outputs.json }}' | jq -cr '.tags[0]') | |
| echo "BUILD_TAG=${BUILD_TAG}" | |
| CACHE_IMAGE=$(echo '${{ steps.meta_cache.outputs.json }}' | jq -cr '.tags[0]') | |
| echo "CACHE_IMAGE=${CACHE_IMAGE}" | |
| RUN_IMAGE=${{ matrix.PLATFORM == 'linux/arm64' && env.RUN_IMAGE_ARM64 || env.RUN_IMAGE_AMD64 }} | |
| echo "RUN_IMAGE=${RUN_IMAGE}" | |
| BUILDER_IMAGE=${{ matrix.PLATFORM == 'linux/arm64' && env.BUILDER_IMAGE_ARM64 || env.BUILDER_IMAGE_AMD64 }} | |
| echo "BUILDER_IMAGE=${BUILDER_IMAGE}" | |
| # publish only on pushes to master or release tags | |
| PUBLISH=0 | |
| EXTRA_FLAGS="" | |
| if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then | |
| PUBLISH=1 | |
| elif [[ "${GITHUB_REF}" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| PUBLISH=1 | |
| fi | |
| [ "${PUBLISH:-}" = "1" ] && EXTRA_FLAGS="--publish --cache-image ${CACHE_IMAGE}" | |
| echo "PUBLISH=${PUBLISH}" | |
| echo "EXTRA_FLAGS=${EXTRA_FLAGS}" | |
| pack build "${BUILD_TAG}" \ | |
| -p "${{ matrix.FLAVOR }}" \ | |
| --builder "${BUILDER_IMAGE}" \ | |
| --run-image "${RUN_IMAGE}" \ | |
| --env BP_RENKU_FRONTENDS="${{ matrix.FRONTEND }}" \ | |
| --platform "${{ matrix.PLATFORM }}" \ | |
| --previous-image "${CACHE_IMAGE}" \ | |
| ${EXTRA_FLAGS} | |
| combine-images: | |
| needs: [build-images] | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| FLAVOR: | |
| - basic | |
| - datascience | |
| FRONTEND: | |
| - jupyterlab | |
| - vscodium | |
| - ttyd | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Login to GitHub Container Registry | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Docker meta | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| env: | |
| DOCKER_METADATA_ANNOTATIONS_LEVELS: index | |
| with: | |
| images: ${{ env.DOCKER_PREFIX }}/py-${{ matrix.FLAVOR }}-${{ matrix.FRONTEND }} | |
| annotations: | | |
| org.opencontainers.image.title=renku/py-${{ matrix.FLAVOR }}-${{ matrix.FRONTEND }} | |
| org.opencontainers.image.description=An image for renku sessions, with ${{ matrix.FLAVOR }} Python packages and a ${{ matrix.FRONTEND }} frontend. | |
| tags: | | |
| type=sha,prefix= | |
| type=raw,value=latest,enable=${{ github.ref == 'refs/heads/master' }} | |
| type=semver,pattern={{version}},event=tag | |
| - name: Docker meta amd64 | |
| id: meta_amd64 | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.DOCKER_PREFIX }}/py-${{ matrix.FLAVOR }}-${{ matrix.FRONTEND }} | |
| tags: | | |
| type=sha,prefix=amd64- | |
| - name: Docker meta arm64 | |
| id: meta_arm64 | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ${{ env.DOCKER_PREFIX }}/py-${{ matrix.FLAVOR }}-${{ matrix.FRONTEND }} | |
| tags: | | |
| type=sha,prefix=arm64- | |
| - name: Combine images | |
| run: | | |
| readarray -t TAG_ARGS<<<$(echo '${{ steps.meta.outputs.json }}' | jq -cr '.tags | map("--tag\n" + .) | join("\n")') | |
| echo "TAG_ARGS=${TAG_ARGS[@]}" | |
| readarray -t ANNOTATION_ARGS<<<$(echo '${{ steps.meta.outputs.json }}' | jq -cr '.annotations | map("--annotation\n" + .) | join("\n")') | |
| echo "ANNOTATION_ARGS=${ANNOTATION_ARGS[@]}" | |
| LINUX_AMD64_IMAGE=$(echo '${{ steps.meta_amd64.outputs.json }}' | jq -cr '.tags[0]') | |
| echo "LINUX_AMD64_IMAGE=${LINUX_AMD64_IMAGE}" | |
| LINUX_ARM64_IMAGE=$(echo '${{ steps.meta_arm64.outputs.json }}' | jq -cr '.tags[0]') | |
| echo "LINUX_ARM64_IMAGE=${LINUX_ARM64_IMAGE}" | |
| # publish only on pushes to master or release tags | |
| PUBLISH=0 | |
| if [[ "${GITHUB_REF}" == "refs/heads/master" ]]; then | |
| PUBLISH=1 | |
| elif [[ "${GITHUB_REF}" =~ ^refs/tags/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| PUBLISH=1 | |
| fi | |
| echo "PUBLISH=${PUBLISH}" | |
| if [[ "${PUBLISH:-}" != "1" ]]; then | |
| echo "Skipping" | |
| exit 0 | |
| fi | |
| set -x | |
| docker buildx imagetools create \ | |
| "${TAG_ARGS[@]}" \ | |
| "${ANNOTATION_ARGS[@]}" \ | |
| "${LINUX_AMD64_IMAGE}" \ | |
| "${LINUX_ARM64_IMAGE}" |