Skip to content

Commit

Permalink
feat: argus-docker-build update multiple envs (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
hspitzley-czi authored May 1, 2024
1 parent cd01f9a commit 0ec8d51
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions .github/workflows/argus-docker-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: Docker Image Build
on:
workflow_call:
inputs:
env:
description: The env that this is building (rdev, staging, or prod)
envs:
description: The envs that this is building (rdev, staging, or prod), comma delimited
required: true
type: string
images:
Expand All @@ -20,6 +20,7 @@ jobs:
outputs:
image-tag: ${{ steps.build-tags.outputs.IMAGE_TAG }}
images: ${{ steps.parse-images.outputs.images }}
envs: ${{ steps.parse-envs.outputs.envs }}
permissions:
id-token: write
contents: read
Expand All @@ -38,6 +39,13 @@ jobs:
script: |
const images = JSON.parse(`${{ inputs.images }}`);
core.setOutput('images', images);
- name: Parse envs
id: parse-envs
uses: actions/github-script@v7
with:
script: |
const envs = `${{ inputs.envs }}`.split(',').map(env => env.trim());
core.setOutput('envs', envs.join(' '));
build-docker:
name: Build Docker Image
needs: [prep]
Expand Down Expand Up @@ -120,10 +128,13 @@ jobs:
- name: Update Manifest
shell: bash
run: |
sed -i 's/tag: sha-\w\+/tag: ${{ env.IMAGE_TAG }}/g' .infra/${{ inputs.env }}/values.yaml
cat .infra/${{ inputs.env }}/values.yaml
for env in ${{ needs.prep.outputs.envs }}
do
sed -i 's/tag: sha-\w\+/tag: ${{ env.IMAGE_TAG }}/g' .infra/${env}/values.yaml
cat .infra/${env}/values.yaml
done
- name: Update Argus manifests
uses: EndBug/add-and-commit@v9
with:
add: -A
message: 'chore: Updated .infra/${{ inputs.env }}/values.yaml image tags to ${{ env.IMAGE_TAG }}'
message: 'chore: Updated [${{ needs.prep.outputs.envs }}] values.yaml image tags to ${{ env.IMAGE_TAG }}'

0 comments on commit 0ec8d51

Please sign in to comment.