Skip to content

Commit

Permalink
Added container rebuild options (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
AhmedBM authored Mar 20, 2024
1 parent 515007e commit 9b06a1e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
5 changes: 4 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
"customizations": {
"vscode": {
"extensions": [
"github.copilot"
"eamodio.gitlens",
"github.copilot",
"github.vscode-github-actions",
"ms-vscode.cpptools-extension-pack"
]
}
},
Expand Down
16 changes: 14 additions & 2 deletions .github/workflows/build-containers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,16 @@ on:
- main
paths:
- devops/docker/**/Dockerfile

workflow_dispatch:
inputs:
distro_list:
description: 'Comma separated list of distros to build. eg. ubuntu-20.04-amd64,ubuntu-20.04-arm64'
type: string
rebuild_all:
description: 'Rebuild all containers'
default: false
type: boolean

env:
REGISTRY: ghcr.io
BUILD_TYPE: Release
Expand All @@ -34,7 +43,10 @@ jobs:
id: matrix
run: |
# If this workflow is present in other_changed_files, then rebuild all containers
if [[ "${{ steps.changed-containers.outputs.other_changed_files }}" == *".github/workflows/build-containers.yml"* ]]; then
if [[ -n "${str// }" ]]; then
echo "Building specified containers..."
containers=$(echo "${{ inputs.distro_list }}" | jq -R 'split(",") | map("devops/docker/" + . + "/Dockerfile")')
elif [[ "${{ steps.changed-containers.outputs.other_changed_files }}" == *".github/workflows/build-containers.yml"* ]] || [[ "${{ inputs.rebuild_all }}" == "true" ]]; then
echo "Workflow file changed, adding all containers to build matrix..."
containers=$(ls -d devops/docker/**/Dockerfile | jq -R . | jq -s .)
else
Expand Down

0 comments on commit 9b06a1e

Please # to comment.