diff --git a/.github/workflows/dotnet-core.yml b/.github/workflows/dotnet-core.yml index 5757fe9..2523dab 100644 --- a/.github/workflows/dotnet-core.yml +++ b/.github/workflows/dotnet-core.yml @@ -12,7 +12,8 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.1.5 + - name: Checkout + uses: actions/checkout@v4.1.5 - name: Setup .NET Core uses: actions/setup-dotnet@v4.0.0 @@ -32,3 +33,34 @@ jobs: run: | wget https://raw.githubusercontent.com/Yucked/Scripy/master/Powershell/ActionSend.ps1 pwsh .\ActionSend.ps1 ${{ secrets.WEBHOOK }} ${{ job.status }} + + + publish: + name: Publish to GitHub + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Docker Login + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Normalize repository name + id: norm_name + run: | + echo IMAGE_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV + + - name: Build and push Docker images + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + ghcr.io/${{ env.IMAGE_NAME }}:latest + ghcr.io/${{ env.IMAGE_NAME }}:${{ github.run_number }}