Skip to content

Update Docker GitHub workflow configuration #3

Update Docker GitHub workflow configuration

Update Docker GitHub workflow configuration #3

Workflow file for this run

name: Build and Push Docker Images
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
config:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.config.outputs.matrix }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Read configuration
id: config
run: |
matrix=$(cat docker-matrix.json | jq -c .)
echo "matrix=$matrix" >> $GITHUB_ENV
shell: bash
build-and-push:
needs: config
runs-on: ubuntu-latest
strategy:
matrix:
include: ${{ fromJson(env.matrix) }}

Check failure on line 33 in .github/workflows/docker-build.yml

View workflow run for this annotation

GitHub Actions / Build and Push Docker Images

Invalid workflow file

The workflow is not valid. .github/workflows/docker-build.yml (Line: 33, Col: 18): Unrecognized named-value: 'env'. Located at position 10 within expression: fromJson(env.matrix) .github/workflows/docker-build.yml (Line: 33, Col: 18): Unexpected value '${{ fromJson(env.matrix) }}'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ matrix.tags }}
file: ${{ matrix.file }}
- name: Logout from Docker Hub
run: docker logout