Analysis Tool Builds #264
This file contains hidden or 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: Analysis Tool Builds | |
| on: | |
| schedule: | |
| - cron: '0 0 * * *' | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: tool-build-group | |
| jobs: | |
| generate-tool-builds: | |
| if: github.repository == 'cisagov/thorium' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| outputs: | |
| matrix: ${{ steps.generate-tool-matrix.outputs.matrix }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: list images to build | |
| id: generate-tool-matrix | |
| run: | | |
| MATRIX=$(python3 tools/scripts/build-actions-matrix.py tools/toolbox.json) | |
| echo "matrix=$(echo $MATRIX | jq -c .)" >> $GITHUB_OUTPUT | |
| build-tools: | |
| name: Build Thorium Tool Image - #${{ matrix.tool.image_name }} | |
| needs: generate-tool-builds | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| strategy: | |
| fail-fast: false | |
| max-parallel: 4 | |
| matrix: | |
| tool: ${{ fromJson(needs.generate-tool-builds.outputs.matrix) }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Login to Container Registry | |
| run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Build Tool Container Image | |
| run: | | |
| IMAGE=${{ matrix.tool.image_name}} | |
| BUILD_PATH=tools/${{ matrix.tool.build_path}} | |
| docker build --file ${BUILD_PATH}/Dockerfile --tag $IMAGE --label "runnumber=${GITHUB_RUN_ID}" ${BUILD_PATH} | |
| docker push $IMAGE |