mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-26 15:51:08 +08:00
refactor ci.yml
This commit is contained in:
parent
fabbc3983e
commit
87e1ebeebd
16
.github/workflows/ci.yml
vendored
16
.github/workflows/ci.yml
vendored
@ -38,7 +38,9 @@ jobs:
|
|||||||
run: dotnet test -c Release --no-restore
|
run: dotnet test -c Release --no-restore
|
||||||
|
|
||||||
- name: Update Release Drafter
|
- name: Update Release Drafter
|
||||||
if: and(github.ref == 'refs/heads/main', success())
|
if: |
|
||||||
|
github.ref == 'refs/heads/main' &&
|
||||||
|
success()
|
||||||
id: last_release
|
id: last_release
|
||||||
uses: release-drafter/release-drafter@v5
|
uses: release-drafter/release-drafter@v5
|
||||||
env:
|
env:
|
||||||
@ -50,7 +52,9 @@ jobs:
|
|||||||
echo "id: ${{ steps.last_release.outputs.id }}"
|
echo "id: ${{ steps.last_release.outputs.id }}"
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
if: and(github.ref == 'refs/heads/main', success())
|
if: |
|
||||||
|
github.ref == 'refs/heads/main' &&
|
||||||
|
success()
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
@ -59,7 +63,9 @@ jobs:
|
|||||||
##ref: https://docs.docker.com/language/golang/configure-ci-cd/
|
##ref: https://docs.docker.com/language/golang/configure-ci-cd/
|
||||||
##ref: https://event-driven.io/en/how_to_buid_and_push_docker_image_with_github_actions
|
##ref: https://event-driven.io/en/how_to_buid_and_push_docker_image_with_github_actions
|
||||||
- name: Build Docker Image
|
- name: Build Docker Image
|
||||||
if: and(github.ref == 'refs/heads/main', success())
|
if: |
|
||||||
|
github.ref == 'refs/heads/main' &&
|
||||||
|
success()
|
||||||
run: |
|
run: |
|
||||||
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/booking-microservices-flight:${{ steps.last_release.outputs.tag_name }} -f "${{ github.workspace }}/src/Services/Flight/Dockerfile" .
|
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/booking-microservices-flight:${{ steps.last_release.outputs.tag_name }} -f "${{ github.workspace }}/src/Services/Flight/Dockerfile" .
|
||||||
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/booking-microservices-identity:${{ steps.last_release.outputs.tag_name }} -f "${{ github.workspace }}/src/Services/Identity/Dockerfile" .
|
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/booking-microservices-identity:${{ steps.last_release.outputs.tag_name }} -f "${{ github.workspace }}/src/Services/Identity/Dockerfile" .
|
||||||
@ -67,7 +73,9 @@ jobs:
|
|||||||
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/booking-microservices-booking:${{ steps.last_release.outputs.tag_name }} -f "${{ github.workspace }}/src/Services/Booking/Dockerfile" .
|
docker build -t ${{ secrets.DOCKERHUB_USERNAME }}/booking-microservices-booking:${{ steps.last_release.outputs.tag_name }} -f "${{ github.workspace }}/src/Services/Booking/Dockerfile" .
|
||||||
|
|
||||||
- name: Publish Docker Image
|
- name: Publish Docker Image
|
||||||
if: and(github.ref == 'refs/heads/main', success())
|
if: |
|
||||||
|
github.ref == 'refs/heads/main' &&
|
||||||
|
success()
|
||||||
run: |
|
run: |
|
||||||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/booking-microservices-flight:${{ steps.last_release.outputs.tag_name }}
|
docker push ${{ secrets.DOCKERHUB_USERNAME }}/booking-microservices-flight:${{ steps.last_release.outputs.tag_name }}
|
||||||
docker push ${{ secrets.DOCKERHUB_USERNAME }}/booking-microservices-identity:${{ steps.last_release.outputs.tag_name }}
|
docker push ${{ secrets.DOCKERHUB_USERNAME }}/booking-microservices-identity:${{ steps.last_release.outputs.tag_name }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user