-
Notifications
You must be signed in to change notification settings - Fork 0
81 lines (70 loc) · 2.45 KB
/
build-auto.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
---
name: build-auto
on:
push:
branches:
- main
workflow_dispatch:
jobs:
changes:
runs-on: ubuntu-latest
outputs:
releases: ${{ steps.changes.outputs.changes }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Create release filters
run: |
for release in $(ls -dl releases/** | grep "^d" | awk '{ print $9 }')
do
echo "$release: $release/**" >> .filters.yml
done
- name: Get changed releases
uses: dorny/paths-filter@v3
id: changes
with:
filters: .filters.yml
build:
runs-on: ubuntu-latest
timeout-minutes: 60
if: ${{ needs.changes.outputs.releases != '[]' }}
needs:
- changes
strategy:
fail-fast: false
matrix:
release: ${{ fromJson(needs.changes.outputs.releases) }}
steps:
- name: Checkout project
uses: actions/checkout@v4
- name: Authenticate with Quay.io
uses: docker/[email protected]
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r ${{ matrix.release }}/requirements.txt
- name: Generate kolla config
run: |
python kolla-builder.py generate-config -i ${{ matrix.release }}/config.yml -o ${{ matrix.release }}/kolla-build.conf
- name: Get release name
id: release_name
run: |
echo name=$(echo ${{ matrix.release }} | sed -r 's/^.{9}//') >> $GITHUB_OUTPUT
- name: Build and push kolla images
run: |
kolla-build --version
kolla-build --config-file ${{ matrix.release }}/kolla-build.conf --template-override ${{ matrix.release }}/template-overrides.j2 --profile main --nopush --template-only --work-dir templates-${{ steps.release_name.outputs.name }}-main
kolla-build --config-file ${{ matrix.release }}/kolla-build.conf --template-override ${{ matrix.release }}/template-overrides.j2 --profile main --push
- name: Upload templates
uses: actions/upload-artifact@v4
if: always()
with:
name: templates-${{ steps.release_name.outputs.name }}-main
path: templates-${{ steps.release_name.outputs.name }}-main/
retention-days: 30