mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-11 02:20:20 +08:00
refactor ci.yml
This commit is contained in:
parent
0fbade9d5a
commit
6263cbb75e
46
.github/workflows/ci.yml
vendored
46
.github/workflows/ci.yml
vendored
@ -27,6 +27,29 @@ jobs:
|
||||
key: ${{ runner.os }}-dotnet-nuget
|
||||
path: ~/.nuget/packages
|
||||
|
||||
- name: Update Release Drafter
|
||||
if: |
|
||||
${{github.ref == 'refs/heads/main'}} &&
|
||||
${{success()}}
|
||||
id: last_release
|
||||
uses: release-drafter/release-drafter@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: "Print result"
|
||||
run: |
|
||||
echo "tag_name: ${{ steps.last_release.outputs.tag_name }}"
|
||||
echo "branch: ${{ github.ref }}"
|
||||
echo "branch: ${{ github.ref }}"
|
||||
|
||||
- name: Login to DockerHub
|
||||
if: |
|
||||
${{ steps.last_release.outputs.tag_name }} != null
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
- name: Restore dependencies
|
||||
run: dotnet restore
|
||||
|
||||
@ -37,27 +60,8 @@ jobs:
|
||||
if: ${{success()}}
|
||||
run: dotnet test -c Release --no-restore
|
||||
|
||||
- name: Update Release Drafter
|
||||
if: |
|
||||
${{github.ref == 'refs/heads/main'}} &&
|
||||
${{success()}}
|
||||
id: last_release
|
||||
uses: release-drafter/release-drafter@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Login to DockerHub
|
||||
if: |
|
||||
${{github.ref == 'refs/heads/main'}} &&
|
||||
${{success()}} &&
|
||||
${{ steps.last_release.outputs.tag_name }} != ''
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_PASSWORD }}
|
||||
|
||||
##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://docs.docker.com/language/golang/configure-ci-cd/
|
||||
##ref: https://event-driven.io/en/how_to_buid_and_push_docker_image_with_github_actions
|
||||
- name: Build Docker Image
|
||||
if: |
|
||||
${{github.ref == 'refs/heads/main'}} &&
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user