Skip to content

fixing image name structure on file versions.json and removing versio… #1

fixing image name structure on file versions.json and removing versio…

fixing image name structure on file versions.json and removing versio… #1

Workflow file for this run

name: "Docker build and push"
on:
push:
branches: [ "master" ]
jobs:
build_images:
name: "Building Images."
runs-on: ubuntu-22.04
steps:
- run: |
jq -r 'map(select(.build == true)).[]
| .stages[] as $stage
| "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
docker_login:
name: "Login Docker."
runs-on: ubuntu-latest
steps:
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
docker_push:
name: "Pushing images to docker hub."
runs-on: ubuntu-22.04
steps:
- 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