Skip to content

fixing jq command docker-image.yml. #5

fixing jq command docker-image.yml.

fixing jq command docker-image.yml. #5

Workflow file for this run

name: "Docker build and push"
on:
push:
branches: [ "master" ]
jobs:
build_and_push:
runs-on: ubuntu-22.04
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v4
- name: "Build images"
run: |
jq -r 'map(select(.build == true)).[]
| .stages[] as $stage

Check failure on line 19 in .github/workflows/docker-image.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/docker-image.yml

Invalid workflow file

You have an error in your yaml syntax on line 19
| \"docker build --no-cache --target \($stage) -t \(.namespace)/\(.name):\(.tag)-\($stage|ascii_downcase) ./\(.path) \"
| split("\n") | .[]' versions.json | while read -r image; do
$($image)
done
- name: "Push Images"
run: |
jq -r 'map(select(.build == true and .push == true)).[] | .stages[] as $stage | "docker push \(.namespace)/\(.name):\(.tag)-\($stage|ascii_downcase) " | split("\n") | .[]' versions.json | while read -r image; do
$($image)
done