Skip to content

Commit 6efa26d

Browse files
authored
ci: Only deploy website if not main (#380)
1 parent 0253bdb commit 6efa26d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/deploy-website.yml

+8
Original file line numberDiff line numberDiff line change
@@ -64,27 +64,31 @@ jobs:
6464
-warnAsError
6565
6666
- name: Package Web API
67+
if: github.ref == 'refs/heads/main'
6768
working-directory: server
6869
run: >
6970
dotnet publish WebApi/WebApi.csproj
7071
--configuration Release
7172
--property:PublishDir="../artifacts/api"
7273
7374
- name: Package Functions
75+
if: github.ref == 'refs/heads/main'
7476
working-directory: server
7577
run: >
7678
dotnet publish Functions/Functions.csproj
7779
--configuration Release
7880
--property:PublishDir="../artifacts/fns"
7981
8082
- name: Save Web API
83+
if: github.ref == 'refs/heads/main'
8184
uses: actions/upload-artifact@v4
8285
with:
8386
name: api
8487
path: "server/artifacts/api"
8588
include-hidden-files: true
8689

8790
- name: Save Functions
91+
if: github.ref == 'refs/heads/main'
8892
uses: actions/upload-artifact@v4
8993
with:
9094
name: fns
@@ -151,12 +155,14 @@ jobs:
151155

152156
steps:
153157
- name: Download Functions package
158+
if: github.ref == 'refs/heads/main'
154159
uses: actions/download-artifact@v4
155160
with:
156161
name: fns
157162
path: artifacts/fns
158163

159164
- name: Download API package
165+
if: github.ref == 'refs/heads/main'
160166
uses: actions/download-artifact@v4
161167
with:
162168
name: api
@@ -169,13 +175,15 @@ jobs:
169175
path: artifacts/web
170176

171177
- name: Deploy Functions
178+
if: github.ref == 'refs/heads/main'
172179
uses: Azure/functions-action@v1
173180
with:
174181
app-name: stock-charts-functions
175182
package: artifacts/fns
176183
publish-profile: ${{ secrets.PUBLISH_PROFILE_FNS }}
177184

178185
- name: Deploy API
186+
if: github.ref == 'refs/heads/main'
179187
uses: azure/webapps-deploy@v3
180188
with:
181189
app-name: stock-charts-api

0 commit comments

Comments
 (0)