Skip to content

Build & Push Core images #335

Build & Push Core images

Build & Push Core images #335

Workflow file for this run

name: Build & Push Core images
on:
push:
branches:
- "master"
paths:
- "dockerfiles/*_devel.Dockerfile"
workflow_run:
workflows:
- "Create new release"
branches:
- "master"
types:
- completed
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
generate_matrix:
runs-on: ubuntu-latest
if: github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success'
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/[email protected]
- id: set-json
run: |
JSON=build/matrix/latest.json
if [[ "${{ github.event_name }}" == "workflow_run" ]]; then
JSON=build/matrix/all.json
fi
echo ::set-output name=json::${JSON}
echo ${JSON}
- id: set-matrix
run: |
CONTENT=$(jq -r 'tostring' ${{ steps.set-json.outputs.json }})
echo ::set-output name=matrix::"${CONTENT}"
echo "${CONTENT}"
build:
needs: generate_matrix
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix: ${{fromJson(needs.generate_matrix.outputs.matrix)}}
steps:
- uses: actions/[email protected]
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker images
run: |
BAKE_JSON=bakefiles/${{ matrix.r_version }}.docker-bake.json \
BAKE_GROUP=${{ matrix.group }} \
BAKE_OPTION=--push \
make bake-json-group