Skip to content

Commit b2fffca

Browse files
authored
Merge pull request #428 from aurelianware/copilot/fix-sitemap-robots-errors
2 parents 6da7293 + 48d146b commit b2fffca

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

.github/workflows/deploy-static-site.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ on:
2323
push:
2424
branches: ["main"]
2525
paths:
26-
- 'site/**'
26+
- 'src/site/**'
2727
- '.github/workflows/deploy-static-site.yml'
2828
- 'infra/main.bicep'
2929

@@ -269,7 +269,7 @@ jobs:
269269
azure_static_web_apps_api_token: ${{ steps.get-token.outputs.deployment_token }}
270270
repo_token: ${{ secrets.GITHUB_TOKEN }}
271271
action: "upload"
272-
app_location: "/site"
272+
app_location: "/src/site"
273273
skip_app_build: true
274274
skip_api_build: true
275275
production_branch: "main"

src/site/staticwebapp.config.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@
2727
"route": "/api/*",
2828
"allowedRoles": ["authenticated"]
2929
},
30+
{
31+
"route": "/sitemap.xml",
32+
"headers": {
33+
"Cache-Control": "public, max-age=3600",
34+
"Content-Type": "application/xml; charset=utf-8"
35+
}
36+
},
37+
{
38+
"route": "/robots.txt",
39+
"headers": {
40+
"Cache-Control": "public, max-age=3600",
41+
"Content-Type": "text/plain; charset=utf-8"
42+
}
43+
},
3044
{
3145
"route": "/*.html",
3246
"headers": {
@@ -54,7 +68,7 @@
5468
],
5569
"navigationFallback": {
5670
"rewrite": "/index.html",
57-
"exclude": ["/portal/*", "/api/*", "/.auth/*", "/assets/*", "/css/*", "/js/*", "/graphics/*"]
71+
"exclude": ["/portal/*", "/api/*", "/.auth/*", "/assets/*", "/css/*", "/js/*", "/graphics/*", "/sitemap.xml", "/robots.txt"]
5872
},
5973
"responseOverrides": {
6074
"401": {

0 commit comments

Comments
 (0)