Skip to content

Publish S2I Build 11.8.0 #39

Publish S2I Build 11.8.0

Publish S2I Build 11.8.0 #39

name: Publish S2I Build 11.8.0
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
on: # yamllint disable-line rule:truthy
schedule:
- cron: '5 4 * * 2'
push:
branches: ["*"]
# Publish semver tags as releases.
# tags: ["v*.*.*"]
paths:
- ".github/workflows/**"
- "containers/s2i-cuda/**"
- "containers/python/ubi8/**"
pull_request:
branches: ["main"]
paths:
- "containers/s2i-cuda/**"
- "containers/python/ubi8/**"
env:
IMAGE_NAME: s2i-cuda
IMAGE_VERSION: 11.8.0
GHCR_REGISTRY: ghcr.io
GHCR_USER: ${{ github.repository_owner }}
GHCR_IMAGE: ${GHCR_REGISTRY}/${GHCR_USER}/${IMAGE_NAME}
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
submodules: 'true'
- name: Prepare
id: prep
run: |
VERSION=${{ env.IMAGE_VERSION }}
GHCR_IMAGE=${{ env.GHCR_IMAGE }}
MINOR=${VERSION%.*}
MAJOR=${VERSION%%.*}
TAGS="${GHCR_IMAGE}:${VERSION}"
echo ::set-output name=name::${{ env.IMAGE_NAME }}
echo ::set-output name=tags::${TAGS}
echo ::set-output name=version::${VERSION}
echo ::set-output name=ghcr_image::${GHCR_IMAGE}
# https://github.com/docker/login-action
- name: Log into GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/[email protected]
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# https://github.com/docker/build-push-action
- name: Build and push core
uses: docker/[email protected]
with:
context: containers/${{ steps.prep.outputs.name }}
file: containers/${{ steps.prep.outputs.name }}/core/Dockerfile.rhel8
push: false
build-args: |
TARGETARCH=amd64
tags: ubi8/s2i-core:latest
# outputs: type=docker,dest=/tmp/image.tar
# - name: Upload artifact
# uses: actions/upload-artifact@v3
# with:
# name: image
# path: /tmp/image.tar
# - name: Download artifact
# uses: actions/download-artifact@v3
# with:
# name: image
# path: /tmp
# - name: Load image
# run: |
# docker load --input /tmp/mimage.tar
# https://github.com/docker/build-push-action
- name: Build and push base
uses: docker/[email protected]
with:
context: containers/s2i-base
file: containers/s2i-base/base/Dockerfile.rhel8
push: ${{ github.event_name != 'pull_request' }}
build-args: |
IMAGE_NAME=${{ steps.prep.outputs.ghcr_image }}:${{ steps.prep.outputs.version }}-cudnn8-devel-ubi8
TARGETARCH=amd64
tags: ${{ steps.prep.outputs.tags }}-cudnn8-devel-ubi8,${{ steps.prep.outputs.ghcr_image }}:latest
labels: org.opencontainers.image.version=${{ steps.prep.outputs.version }}-cudnn8-runtime-ubi8