Skip to content

add logs

add logs #72

name: Push Docker Hub Images
on:
push:
branches:
- develop
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Login to Docker Hub
run: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- name: Build and push Docker images
run: |
mapfile -t json_array < <(jq -r '.[] | .name + " " + .tag' versions.json)
for element in "${json_array[@]}"; do
name=$(echo "$element" | cut -d ' ' -f 1)
tag=$(echo "$element" | cut -d ' ' -f 2)
echo "pushing >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> $name"
docker build -t runonflux/wp-nginx:dev-$name --build-arg BASE_IMAGE=wordpress:$tag .
docker push runonflux/wp-nginx:dev-$name
done