Skip to content

Commit

Permalink
Do not run CI build for documentation changes (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdovaz authored Sep 29, 2023
1 parent 8b3dde4 commit 9fc7ce1
Showing 1 changed file with 39 additions and 33 deletions.
72 changes: 39 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: ci

env:
Expand All @@ -6,43 +7,48 @@ env:
on:
push:
paths-ignore:
- 'doc/**'
- 'img/**'
- 'changelog.md'
- 'readme.md'
- doc/**
- img/**
- changelog.md
- readme.md
pull_request:
paths-ignore:
- doc/**
- img/**
- changelog.md
- readme.md

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Build & test (Release)
run: dotnet test src -c Release
- name: Should Deploy?
if: github.event_name == 'push'
run: |
if ( "${{github.ref}}" -match "^refs/tags/[0-9]+\.[0-9]+\.[0-9]+" ) {
echo "UNITYNUGET_DEPLOY=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
- name: Publish (Release)
if: env.UNITYNUGET_DEPLOY == 1
run: dotnet publish src/UnityNuGet.Server/UnityNuGet.Server.csproj -c Release -o build/${{env.PROJECT_NAME}}

- name: Azure Deploy
if: env.UNITYNUGET_DEPLOY == 1
uses: azure/webapps-deploy@v2
with:
app-name: unitynuget-registry
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: build/${{env.PROJECT_NAME}}
- name: Checkout
uses: actions/checkout@v4

- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Build & test (Release)
run: dotnet test src -c Release

- name: Should Deploy?
if: github.event_name == 'push'
run: |
if ( "${{github.ref}}" -match "^refs/tags/[0-9]+\.[0-9]+\.[0-9]+" ) {
echo "UNITYNUGET_DEPLOY=1" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf-8 -Append
}
- name: Publish (Release)
if: env.UNITYNUGET_DEPLOY == 1
run: dotnet publish src/UnityNuGet.Server/UnityNuGet.Server.csproj -c Release -o build/${{env.PROJECT_NAME}}

- name: Azure Deploy
if: env.UNITYNUGET_DEPLOY == 1
uses: azure/webapps-deploy@v2
with:
app-name: unitynuget-registry
publish-profile: ${{ secrets.AZURE_WEBAPP_PUBLISH_PROFILE }}
package: build/${{env.PROJECT_NAME}}

0 comments on commit 9fc7ce1

Please sign in to comment.