-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.67 KB
/
build-push.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
name: radix-image-builder-build
on:
push:
branches:
- master
- release
- playground
- buildah
permissions:
id-token: write
jobs:
get-target-configs:
name: Get target configs for branch
outputs:
target_configs: ${{ steps.get-target-configs.outputs.target_configs }}
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Get target configs
id: get-target-configs
run: |
configs=$(ls $GITHUB_WORKSPACE/.github/workflows/config/${GITHUB_REF_NAME} | jq -Rsc '. / "\n" - [""]')
echo ::set-output name=target_configs::${configs}
build-deploy-image:
name: Build & push
runs-on: ubuntu-20.04
needs:
- get-target-configs
strategy:
fail-fast: false
matrix:
config: ${{ fromJson(needs.get-target-configs.outputs.target_configs) }}
script: [build-push-classic-image-builder.sh, build-push-buildah-image-builder.sh]
steps:
- uses: actions/checkout@v2
- name: Persist environment from ${{ matrix.config }} across steps
run: |
env_vars_from_cfg=`env -i GITHUB_WORKSPACE=$GITHUB_WORKSPACE /bin/bash -c "set -a && source $GITHUB_WORKSPACE/.github/workflows/config/${GITHUB_REF_NAME}/${{ matrix.config }} && printenv"`
for env_var in $env_vars_from_cfg
do
echo $env_var >> $GITHUB_ENV
done
- uses: azure/login@v1
with:
client-id: ${{ env.AZURE_CLIENT_ID }}
tenant-id: ${{ env.AZURE_TENANT_ID }}
subscription-id: ${{ env.AZURE_SUBSCRIPTION_ID }}
- name: Build image
run: |
$GITHUB_WORKSPACE/.github/workflows/scripts/${{ matrix.script }}