diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index e04768b..01c7446 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -1,4 +1,4 @@ -# This workflow will build a .NET project +# This workflow will build a .NET project and push the built files to the latest branch # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net name: .NET @@ -16,6 +16,8 @@ jobs: steps: - uses: actions/checkout@v3 + with: + fetch-depth: 0 # Fetch all history for all branches - name: Setup .NET uses: actions/setup-dotnet@v3 with: @@ -26,3 +28,17 @@ jobs: run: dotnet build --no-restore - name: Test run: dotnet test --no-build --verbosity normal + - name: Archive build output + run: | + mkdir -p build_output + cp -r ./bin/Debug/net8.0/* build_output/ + - name: Commit and push to latest + if: success() + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git checkout latest || git checkout -b latest + cp -r build_output/* . + git add . + git commit -m "Update build output from master" + git push origin latest