Fix audio & collision issues, reorganize performance images - Defer A… #10
This file contains hidden or 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: Deploy to GitHub Pages | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '18' | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: | | |
NODE_ENV=production npm run build | |
touch dist/.nojekyll | |
ls -la dist/ | |
ls -la dist/assets/ | |
cat dist/index.html | grep -E "(script|link)" | |
- name: Deploy built files to root for GitHub Pages | |
run: | | |
# Backup development files | |
mkdir -p backup-dev | |
cp index.html backup-dev/ | |
cp -r src backup-dev/ 2>/dev/null || true | |
# Copy built files to root | |
cp -r dist/* . | |
# Commit and push the changes | |
git config --local user.email "action@github.com" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Deploy: Update root with built files [skip ci]" || echo "No changes to commit" | |
git push || echo "Nothing to push" | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |