Skip to content

Move containers build to CI #5

Move containers build to CI

Move containers build to CI #5

Workflow file for this run

name: Docker Containers
on:
push:
paths:
- build/containers/**
jobs:
changed-containers:
runs-on: ubuntu-latest
outputs:
containers: ${{ steps.determine-containers.outputs.containers }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 2
- id: determine-containers
name: Determine changed containers
run: |
containers=$( build/containers/build.sh --changed-containers-as-json)
echo "containers=${containers}" >> "$GITHUB_OUTPUT"
build-containers:
runs-on: ubuntu-latest
needs: changed-containers
strategy:
max-parallel: 4
fail-fast: true
matrix:
container: ${{ fromJSON(needs.changed-containers.outputs.containers) }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to DockerHub
if: ${{ secrets.DOCKER_USERNAME != '' }}

Check failure on line 40 in .github/workflows/containers.yaml

View workflow run for this annotation

GitHub Actions / Docker Containers

Invalid workflow file

The workflow is not valid. .github/workflows/containers.yaml (Line: 40, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.DOCKER_USERNAME != '' .github/workflows/containers.yaml (Line: 57, Col: 13): Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.DOCKER_USERNAME != ''
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Build Docker image
run: build/containers/build.sh --containers ${{ matrix.container }}
push-containers:
runs-on: ubuntu-latest
needs:
- changed-containers
- build-containers
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to DockerHub
if: ${{ secrets.DOCKER_USERNAME != '' }}
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Push Docker images
if: ${{ secrets.DOCKER_USERNAME != '' }}
run: |
containers=${{ needs.changed-containers.outputs.containers }}
containers=$( echo "${containers}" | sed 's/[][]//g' )
build/containers/build.sh --dry-run --skip-build --push --containers "${containers}"