-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (87 loc) · 2.99 KB
/
build-base-images.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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