diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bb34f8..844a2af 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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'}} &&