feat: update to latest versions #56
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Image Building | |
on: | |
push: | |
branches: | |
- "main" | |
paths: | |
- "containers/**" | |
- ".github/workflows/**" | |
jobs: | |
generate-matrix: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
- name: Calculate file differences | |
id: diff | |
uses: tj-actions/changed-files@8238a4103220c636f2dad328ead8a7c8dbe316a3 # v39.2.0 | |
with: | |
files_yaml: | | |
containers: | |
- containers/** | |
workflows: | |
- ./.github/workflows/** | |
- name: Generate Matrix | |
id: matrix | |
run: | | |
base_changed=false | |
docker_changed=false | |
go_changed=false | |
node_changed=false | |
sysdig_changed=false | |
for path in ${{steps.diff.outputs.workflows_all_changed_and_modified_files}}; do | |
filename=$(basename "${path}") | |
case ${filename%.*} in | |
build-base) | |
base_changed=true | |
;; | |
build-docker) | |
docker_changed=true | |
;; | |
build-go) | |
go_changed=true | |
;; | |
build-node) | |
node_changed=true | |
;; | |
build-sysdig) | |
sysdig_changed=true | |
;; | |
esac | |
done | |
for path in ${{steps.diff.outputs.containers_all_changed_and_modified_files}}; do | |
foldername=$(echo $path | cut -d / -f 2) | |
case ${foldername%.*} in | |
base) | |
base_changed=true | |
;; | |
docker) | |
docker_changed=true | |
;; | |
go) | |
go_changed=true | |
;; | |
node) | |
node_changed=true | |
;; | |
sysdig) | |
sysdig_changed=true | |
;; | |
esac | |
done | |
echo "base_changed=${base_changed}" >> $GITHUB_OUTPUT | |
echo "docker_changed=${docker_changed}" >> $GITHUB_OUTPUT | |
echo "go_changed=${go_changed}" >> $GITHUB_OUTPUT | |
echo "node_changed=${node_changed}" >> $GITHUB_OUTPUT | |
echo "sysdig_changed=${sysdig_changed}" >> $GITHUB_OUTPUT | |
outputs: | |
base_changed: ${{ steps.matrix.outputs.base_changed }} | |
docker_changed: ${{ steps.matrix.outputs.docker_changed }} | |
go_changed: ${{ steps.matrix.outputs.go_changed }} | |
node_changed: ${{ steps.matrix.outputs.node_changed }} | |
sysdig_changed: ${{ steps.matrix.outputs.sysdig_changed }} | |
rebuild-base: | |
needs: generate-matrix | |
if: needs.generate-matrix.outputs.base_changed == 'true' | |
uses: ./.github/workflows/build-base.yml | |
secrets: inherit | |
rebuild-docker: | |
needs: generate-matrix | |
if: needs.generate-matrix.outputs.base_changed == 'false' && needs.generate-matrix.outputs.docker_changed == 'true' | |
uses: ./.github/workflows/build-docker.yml | |
secrets: | |
BOT_DOCKER_USERNAME: ${{ secrets.BOT_DOCKER_USERNAME }} | |
BOT_DOCKER_TOKEN: ${{ secrets.BOT_DOCKER_TOKEN }} | |
BOT_USER: ${{ secrets.BOT_USER }} | |
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | |
rebuild-go: | |
needs: generate-matrix | |
if: needs.generate-matrix.outputs.base_changed == 'false' && needs.generate-matrix.outputs.go_changed == 'true' | |
uses: ./.github/workflows/build-go.yml | |
secrets: | |
BOT_DOCKER_USERNAME: ${{ secrets.BOT_DOCKER_USERNAME }} | |
BOT_DOCKER_TOKEN: ${{ secrets.BOT_DOCKER_TOKEN }} | |
BOT_USER: ${{ secrets.BOT_USER }} | |
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | |
rebuild-node: | |
needs: generate-matrix | |
if: needs.generate-matrix.outputs.base_changed == 'false' && needs.generate-matrix.outputs.node_changed == 'true' | |
uses: ./.github/workflows/build-node.yml | |
secrets: | |
BOT_DOCKER_USERNAME: ${{ secrets.BOT_DOCKER_USERNAME }} | |
BOT_DOCKER_TOKEN: ${{ secrets.BOT_DOCKER_TOKEN }} | |
BOT_USER: ${{ secrets.BOT_USER }} | |
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} | |
rebuild-sysdig: | |
needs: generate-matrix | |
if: needs.generate-matrix.outputs.base_changed == 'false' && needs.generate-matrix.outputs.sysdig_changed == 'true' | |
uses: ./.github/workflows/build-sysdig.yml | |
secrets: | |
BOT_DOCKER_USERNAME: ${{ secrets.BOT_DOCKER_USERNAME }} | |
BOT_DOCKER_TOKEN: ${{ secrets.BOT_DOCKER_TOKEN }} | |
BOT_USER: ${{ secrets.BOT_USER }} | |
BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }} |