Skip to content

Commit

Permalink
CB-22 Update build-and-push.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
izzat5233 committed Nov 21, 2024
1 parent bfa71fc commit 2d1c7e1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/build-and-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@ jobs:
fi
# Define the image name and full image path
IMAGE_NAME="docker.io/${{ secrets.DOCKER_USERNAME }}/chatbot-builder-executor"
FULL_IMAGE_NAME="${IMAGE_NAME}:${IMAGE_TAG}"
IMAGE_NAME="chatbot-builder-executor"
IMAGE_FULL_NAME="$docker.io/${{ secrets.DOCKER_USERNAME }}/${IMAGE_NAME}:${IMAGE_TAG}"
# Build and push the Docker image to Docker Hub
docker build -t "$FULL_IMAGE_NAME" .
docker push "$FULL_IMAGE_NAME"
docker build -t "$IMAGE_FULL_NAME" .
docker push "$IMAGE_FULL_NAME"
# Export variables for use in the next steps
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
echo "IMAGE_NAME=${IMAGE_NAME}" >> $GITHUB_ENV
echo "FULL_IMAGE_NAME=${FULL_IMAGE_NAME}" >> $GITHUB_ENV
echo "IMAGE_FULL_NAME=${IMAGE_FULL_NAME}" >> $GITHUB_ENV
echo "EVENT_TYPE=${EVENT_TYPE}" >> $GITHUB_ENV
- name: Trigger deployment in infra repo
Expand All @@ -52,4 +51,4 @@ jobs:
-H "Authorization: token ${{ secrets.PERSONAL_ACCESS_TOKEN }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
https://api.github.com/repos/Chatbot-Builder-Project/chatbot-builder-infra/dispatches \
-d '{"event_type":"'"${{ env.EVENT_TYPE }}"'", "client_payload": {"image_name": "'"${{ env.IMAGE_NAME }}"'", "image_tag": "'"${{ env.IMAGE_TAG }}"'"}}'
-d '{"event_type":"'"${{ env.EVENT_TYPE }}"'", "client_payload": {"image_full_name": "'"${{ env.IMAGE_FULL_NAME }}"'", "image_manifest_name": "'"${{ env.IMAGE_NAME }}"'"}}'

0 comments on commit 2d1c7e1

Please sign in to comment.