Skip to content

Commit

Permalink
conditional publish
Browse files Browse the repository at this point in the history
  • Loading branch information
daveboster committed Nov 24, 2023
1 parent d42a436 commit 2ca7b79
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .github/workflows/tasks-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
include:
- os: ubuntu-latest
dotnet: '7.x'
publish: true
publish: ${{ (github.event_name == 'push' && github.ref == 'ref/head/main') || (github.event_name == 'pull_request' && github.event.action != 'closed') }}

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -92,6 +92,7 @@ jobs:
fail-on-error: true

- name: Create a Zip package 🐙
if: ${{ matrix.publish }}
id: create-zip-package
uses: OctopusDeploy/create-zip-package-action@v3
with:
Expand All @@ -103,6 +104,7 @@ jobs:
**/*.*
- name: Create a NuGet package 🐙
if: ${{ matrix.publish }}
id: create-nuget-package
uses: OctopusDeploy/create-nuget-package-action@v3
with:
Expand All @@ -117,13 +119,15 @@ jobs:
Dave Boster
- name: Upload Zip package to build artifacts 🗳️
if: ${{ matrix.publish }}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.create-zip-package.outputs.package_filename }}
path: ${{ steps.create-zip-package.outputs.package_file_path }}
retention-days: 1

- name: Upload NuGet package to build artifacts 🗳️
if: ${{ matrix.publish }}
uses: actions/upload-artifact@v3
with:
name: ${{ steps.create-nuget-package.outputs.package_filename }}
Expand Down

0 comments on commit 2ca7b79

Please sign in to comment.