Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,24 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'

- name: Install dependencies
run: yarn install --frozen-lockfile

- name: Generate sitemap
run: yarn generate-sitemap
env:
# Tags (v*) = production, pushes to main = staging
# URLs are resolved from ISAAC_ENV in scripts/sitemap-config.ts,
# mirroring the envSpecific() pattern from src/app/services/constants.ts
ISAAC_ENV: ${{ startsWith(github.ref, 'refs/tags/') && 'production' || 'staging' }}

- name: Log in to the Container registry
uses: docker/login-action@v3
with:
Expand Down
4 changes: 4 additions & 0 deletions config/webpack.config.cs.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ module.exports = env => {
},{
from: resolve('public/robots.txt'),
to: 'robots.txt',
}, {
from: resolve('public/sitemap.xml'),
to: 'sitemap.xml',
noErrorOnMissing: true, // Sitemap is generated separately so is ok
}]
}),
],
Expand Down
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"uuid": "^9.0.1"
},
"scripts": {
"generate-sitemap": "ts-node --project scripts/tsconfig.json scripts/generate-sitemap.ts",
"build-cs": "webpack --env prod --config config/webpack.config.cs.js",
"build-dev": "webpack --config config/webpack.config.cs.js",
"start": "webpack-dev-server --hot --port 8003 --history-api-fallback --config config/webpack.config.cs.js --allowed-hosts=true",
Expand Down Expand Up @@ -104,7 +105,9 @@
}
}
},
"eslintIgnore": ["/src/IsaacApiTypesAutoGenerated.tsx"],
"eslintIgnore": [
"/src/IsaacApiTypesAutoGenerated.tsx"
],
"browserslist": [
">0.2%",
"not dead",
Expand All @@ -128,9 +131,11 @@
"@types/html-to-text": "^9.0.4",
"@types/jest": "^29.5.12",
"@types/js-cookie": "^3.0.6",
"@types/js-yaml": "^4.0.9",
"@types/katex": "^0.16.7",
"@types/leaflet": "^1.9.6",
"@types/lodash": "^4.17.5",
"@types/node": "^20.11.0",
"@types/object-hash": "^3.0.4",
"@types/qrcode": "^1.5.2",
"@types/react-beautiful-dnd": "^13.1.8",
Expand Down Expand Up @@ -166,6 +171,7 @@
"jest": "^29.7.0",
"jest-environment-jsdom": "^29.7.0",
"jest-watch-typeahead": "^2.2.2",
"js-yaml": "^4.1.1",
"mini-css-extract-plugin": "^2.9.0",
"msw": "^1.3.3",
"prettier": "^3.0.3",
Expand All @@ -179,6 +185,7 @@
"style-loader": "^3.3.4",
"ts-jest": "^29.4.6",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"typescript": "^4.9.5",
"webpack": "^5.101.3",
"webpack-bundle-analyzer": "^4.10.2",
Expand Down
5 changes: 4 additions & 1 deletion public/robots.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,7 @@ Disallow:
# Allow Googlebot access to everything
User-agent: Googlebot
User-agent: Bingbot
Disallow:
Disallow:

# Sitemap location
Sitemap: https://isaaccomputerscience.org/sitemap.xml
Loading
Loading