Updated build_matrix.json #24
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: Build All | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- build_matrix.json | |
jobs: | |
discover: | |
runs-on: ubuntu-latest | |
outputs: | |
build_matrix: ${{ steps.discover.outputs.build_matrix }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: discover | |
run: echo "build_matrix=$(jq -r '. | tostring' build_matrix.json)" | tee -a "$GITHUB_OUTPUT" | |
build: | |
name: "build (${{ matrix.tag }})" | |
needs: discover | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
strategy: | |
fail-fast: false | |
matrix: ${{ fromJSON(needs.discover.outputs.build_matrix) }} | |
env: | |
docker_repo: ndunnett/python | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push image | |
shell: bash | |
run: | | |
set -eux | |
docker build . --tag "${{ env.docker_repo }}:${{ matrix.tag }}" \ | |
--build-arg "PYTHON_VERSION=${{ matrix.python_version }}" \ | |
--build-arg "BASE_IMAGE=${{ matrix.base_image_repo }}" \ | |
--build-arg "BASE_IMAGE_TAG=${{ matrix.base_image_tag }}" \ | |
docker push "${{ env.docker_repo }}:${{ matrix.tag }}" | |
- name: Push alias tags | |
shell: bash | |
run: | | |
set -eux | |
for tag_alias in ${{ matrix.aliases }}; do | |
docker manifest create "${{ env.docker_repo }}:$tag_alias" "${{ env.docker_repo }}:${{ matrix.tag }}" | |
docker manifest push "${{ env.docker_repo }}:$tag_alias" | |
done |