-
Notifications
You must be signed in to change notification settings - Fork 2
85 lines (81 loc) · 2.76 KB
/
build.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
name: build-containers
on:
workflow_dispatch:
inputs:
kolla_build_profile:
description: "Kolla profile(s) to build (e.g., 'base', 'ironic'), comma-separated"
kolla_build_pattern:
description: "Kolla image build pattern (e.g., '^ironic-')"
push:
type: choice
description: "Push images to registry? (true/false)"
required: true
default: 'false'
options:
- 'true'
- 'false'
tag:
description: "Override default tag"
cache:
type: choice
default: 'false'
options:
- 'true'
- 'false'
pull:
description: "Should kolla-build pull the OS bas image before build"
type: choice
default: 'false'
options:
- 'true'
- 'false'
env:
DOCKER_REGISTRY: ghcr.io
KOLLA_NAMESPACE_DEV: chameleoncloud/kolla-dev
KOLLA_NAMESPACE_PROD: chameleoncloud/kolla
jobs:
build-containers:
environment: Chameleon CI
runs-on: ubuntu-latest
steps:
- name: Set profile argument from workflow inputs
if: github.event.inputs.kolla_build_profile != ''
run: echo "KOLLA_BUILD_PROFILE=${{ github.event.inputs.kolla_build_profile }}" >> $GITHUB_ENV
- name: Set pattern argument from workflow inputs
if: github.event.inputs.kolla_build_pattern != ''
run: echo "KOLLA_BUILD_PATTERN=${{ github.event.inputs.kolla_build_pattern }}" >> $GITHUB_ENV
- name: Set push argument from workflow inputs
if: github.event.inputs.push == 'true'
run: echo "SHOULD_PUSH=1" >> $GITHUB_ENV
- name: Set Cache argument from workflow inputs
if: github.event.inputs.cache == 'true'
run: echo "KOLLA_CACHE=1" >> $GITHUB_ENV
- name: Set Pull argument from workflow inputs
if: github.event.inputs.pull == 'true'
run: echo "PULL=1" >> $GITHUB_ENV
- name: Set tag argument from workflow inputs
if: github.event.inputs.tag != ''
run: echo "DOCKER_TAG=${{ github.event.inputs.tag }}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
cache: 'pip' # caching pip dependencies
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
with:
install: true
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Run Kolla Build
run: |
./run.sh python3 build.py