-
Notifications
You must be signed in to change notification settings - Fork 7
96 lines (86 loc) · 2.71 KB
/
build-base-image.yml
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
91
92
93
94
95
96
# Apache License 2.0
name: Build Base Development Image
on:
push:
branches:
- main
pull_request:
release:
types: [published]
concurrency:
group: main-${{ github.ref }}
cancel-in-progress: true
env:
PROJECT_NAME: open-space-toolkit-base
jobs:
prepare-environment:
name: Prepare Environment Variables
runs-on: ubuntu-latest
outputs:
project_name: ${{ steps.project-name.outputs.value }}
project_version: ${{ steps.project-version.outputs.value }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- id: project-name
name: Get Project Name
run: |
echo "Project name: ${{ env.PROJECT_NAME }}"
echo "value=${{ env.PROJECT_NAME }}" >> $GITHUB_OUTPUT
- id: project-version
name: Get Project Version
run: |
project_version=$(git describe --tags --always)
echo "Project version: ${project_version}"
echo "value=${project_version}" >> $GITHUB_OUTPUT
build-part1-of-base-image:
name: Build Part 1 of Base Image
needs:
- prepare-environment
uses: ./.github/workflows/build-image.yml
with:
project_name: ${{ needs.prepare-environment.outputs.project_name }}
project_version: ${{ needs.prepare-environment.outputs.project_version }}
push: false
target: base1
secrets: inherit
build-part2-of-base-image:
name: Build Part 2 of Base Image
needs:
- prepare-environment
- build-part1-of-base-image
uses: ./.github/workflows/build-image.yml
with:
project_name: ${{ needs.prepare-environment.outputs.project_name }}
project_version: ${{ needs.prepare-environment.outputs.project_version }}
push: false
target: base2
secrets: inherit
build-part3-and-push-and-tag-base-image:
name: Build Part 3 and Push and Tag Base Image with Version
needs:
- prepare-environment
- build-part2-of-base-image
uses: ./.github/workflows/build-image.yml
with:
project_name: ${{ needs.prepare-environment.outputs.project_name }}
project_version: ${{ needs.prepare-environment.outputs.project_version }}
push: true
target: base3
secrets: inherit
push-and-tag-base-image-as-latest:
if: github.event_name == 'release' && github.event.action == 'published'
name: Push and Tag Base Image as Latest
needs:
- prepare-environment
- build-part3-and-push-and-tag-base-image
uses: ./.github/workflows/build-image.yml
with:
project_name: ${{ needs.prepare-environment.outputs.project_name }}
project_version: latest
push: true
target: base3
secrets: inherit