Skip to content

Commit

Permalink
ci: Only deploy website if not main (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveSkender authored Jan 6, 2025
1 parent 0253bdb commit 6efa26d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,31 @@ jobs:
-warnAsError
- name: Package Web API
if: github.ref == 'refs/heads/main'
working-directory: server
run: >
dotnet publish WebApi/WebApi.csproj
--configuration Release
--property:PublishDir="../artifacts/api"
- name: Package Functions
if: github.ref == 'refs/heads/main'
working-directory: server
run: >
dotnet publish Functions/Functions.csproj
--configuration Release
--property:PublishDir="../artifacts/fns"
- name: Save Web API
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: api
path: "server/artifacts/api"
include-hidden-files: true

- name: Save Functions
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: fns
Expand Down Expand Up @@ -151,12 +155,14 @@ jobs:

steps:
- name: Download Functions package
if: github.ref == 'refs/heads/main'
uses: actions/download-artifact@v4
with:
name: fns
path: artifacts/fns

- name: Download API package
if: github.ref == 'refs/heads/main'
uses: actions/download-artifact@v4
with:
name: api
Expand All @@ -169,13 +175,15 @@ jobs:
path: artifacts/web

- name: Deploy Functions
if: github.ref == 'refs/heads/main'
uses: Azure/functions-action@v1
with:
app-name: stock-charts-functions
package: artifacts/fns
publish-profile: ${{ secrets.PUBLISH_PROFILE_FNS }}

- name: Deploy API
if: github.ref == 'refs/heads/main'
uses: azure/webapps-deploy@v3
with:
app-name: stock-charts-api
Expand Down

0 comments on commit 6efa26d

Please sign in to comment.