this should wokr #10
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Deploy Site | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Step 1: Check out the repository. | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
# Step 2: Set up Node.js (to match your local Node.js version) | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22.12.0' # Ensure this matches your local Node.js version | |
# Step 3: Verify Node.js Version | |
- name: Verify Node.js Version | |
run: node --version | |
# Step 4: Set up Bun | |
- name: Set up Bun | |
uses: oven-sh/setup-bun@v1 | |
with: | |
bun-version: latest | |
# Step 5: Install dependencies | |
- name: Install dependencies | |
working-directory: ./docs # Adjust if your package.json is elsewhere | |
run: | | |
rm -rf node_modules # Clear old dependencies | |
bun install | |
# Step 6: Build the site | |
- name: Build the site | |
working-directory: ./docs # Adjust if your build script is elsewhere | |
run: bun run build | |
# Step 7: Copy build output to docs folder | |
- name: Copy build output to docs | |
run: | | |
mkdir -p docs # Ensure the docs folder exists | |
cp -r ./docs/.next/* ./docs/ # Adjust 'dist' if your build output folder is different | |
# Step 8: Commit changes to docs folder | |
- name: Commit changes | |
run: | | |
git config --global user.name "GitHub Actions" | |
git config --global user.email "[email protected]" | |
git add docs | |
git commit -m "Update docs with new build output" || echo "No changes to commit" | |
git push | |
# Step 9: Generate Sitemap | |
- name: Generate Sitemap | |
working-directory: ./docs | |
run: NODE_OPTIONS='--experimental-json-modules' node ./scripts/generate-sitemap.mjs |