Skip to content

Merge pull request #135 from equinor/main #150

Merge pull request #135 from equinor/main

Merge pull request #135 from equinor/main #150

Workflow file for this run

name: radix-tekton-build
on:
push:
branches: [main, release]
permissions:
actions: read
checks: read
contents: read
deployments: read
id-token: write
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
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@v4
- name: Get target configs
id: get-target-configs
run: |
configs=$(ls $GITHUB_WORKSPACE/.github/workflows/config/${GITHUB_REF_NAME} | jq -Rsc '. / "\n" - [""]')
echo "target_configs=${configs}" >> $GITHUB_OUTPUT
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) }}
steps:
- uses: actions/checkout@v4
- 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/build-push.sh