booking-microservices/.github/workflows/build-publish-docker.yml
Workflow config file is invalid. Please check your config file: yaml: line 21: mapping values are not allowed in this context
meysamhadeli b61c07db82 .
2023-01-25 00:30:34 +03:30

52 lines
1.8 KiB
YAML

name: build-publish-docker
on:
push:
branches: [ develop ]
pull_request:
jobs:
build-and-push-docker-image:
name: Build and Publish Docker image to DockerHub
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Process version of the tag
id: version
uses: ncipollo/semantic-version-action@v1
- name: Dump steps context
env:
STEPS_CONTEXT: ${{ toJson(steps.version.outputs) }}
run: echo "$STEPS_CONTEXT"
#
# - name: Get release tag
# run: echo "::set-output name=tag::$(echo $GITHUB_REF)"
#
# - name: Print release tag
# run: echo "The release tag is ${{ steps.get_tag.outputs.tag }}"
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Build image
run: |
docker build -t meysamh66/booking-microservices-flight:latest -f "${{ github.workspace }}/src/Services/Flight/Dockerfile" .
docker build -t meysamh66/booking-microservices-identity:latest -f "${{ github.workspace }}/src/Services/Identity/Dockerfile" .
docker build -t meysamh66/booking-microservices-passenger:latest -f "${{ github.workspace }}/src/Services/Passenger/Dockerfile" .
docker build -t meysamh66/booking-microservices-booking:latest -f "${{ github.workspace }}/src/Services/Booking/Dockerfile" .
- name: Publish image
run: |
docker push meysamh66/booking-microservices-flight:latest
docker push meysamh66/booking-microservices-identity:latest
docker push meysamh66/booking-microservices-passenger:latest
docker push meysamh66/booking-microservices-booking:latest