Skip to content

Build base images for SAVE execution #157

Build base images for SAVE execution

Build base images for SAVE execution #157

name: Build base images for SAVE execution
on:
schedule:
- cron: '0 4 * * 1'
workflow_dispatch:
inputs:
branch:
type: string
default: master
description: Branch to build images from
required: false
jobs:
build_base_images:
name: Build base images and push to ghcr.io
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# This should replicate list of SDKs from com.saveourtool.save.domain.Sdk
include:
- base_image_name: eclipse-temurin
base_image_tag: 8-focal
- base_image_name: eclipse-temurin
base_image_tag: 11-focal
- base_image_name: eclipse-temurin
base_image_tag: 17-focal
- base_image_name: python
base_image_tag: 2.7
- base_image_name: python
base_image_tag: 3.5
- base_image_name: python
base_image_tag: 3.6
- base_image_name: python
base_image_tag: 3.7
- base_image_name: python
base_image_tag: 3.8
- base_image_name: python
base_image_tag: 3.9
- base_image_name: python
base_image_tag: '3.10'
- base_image_name: ubuntu
base_image_tag: '20.04'
steps:
- uses: actions/checkout@v4
- if: github.event_name == 'workflow_dispatch'
name: Prepare to build from branch
run: |
git fetch
git checkout origin/${{ inputs.branch }}
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: saveourtool
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare formatted tags
run: |
echo FORMATTED_TAG=${{ matrix.base_image_tag }} | sed -e "s/-focal$//" | sed -e "s/20.04$/latest/" >> $GITHUB_ENV
- uses: docker/build-push-action@v6
with:
context: save-deploy/base-images
push: true
# https://github.com/marketplace/actions/build-and-push-docker-images#inputs
# '`List` type is a newline-delimited string'
build-args: |
BASE_IMAGE=${{ matrix.base_image_name }}:${{ matrix.base_image_tag }}
BASE_IMAGE_NAME=${{ matrix.base_image_name }}
tags: ghcr.io/saveourtool/save-base:${{ matrix.base_image_name }}-${{ env.FORMATTED_TAG }}
build_custom_builder_image:
name: Build custom Paketo builder for CPG-demo
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- if: github.event_name == 'workflow_dispatch'
name: Prepare to build from branch
run: |
git fetch
git checkout origin/${{ inputs.branch }}
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: saveourtool
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v6
with:
context: save-demo-cpg/builder
push: true
tags: ghcr.io/saveourtool/builder:base-plus-gcc