Deploy to GitHub Pages #7
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 ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: | | |
| npm install | |
| npm install @types/node @types/react @types/react-dom typescript | |
| - name: Build | |
| run: | | |
| npm run build --no-lint | |
| env: | |
| CI: false | |
| - name: Debug output | |
| if: failure() | |
| run: | | |
| echo "Build failed. Checking directory contents:" | |
| ls -la | |
| echo "Checking build logs:" | |
| cat .next/build-error.log || true | |
| - name: Add .nojekyll file | |
| run: | | |
| touch ./out/.nojekyll | |
| mkdir -p ./out/residency-planner | |
| cp -r ./out/* ./out/residency-planner/ || true | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./out | |
| force_orphan: true |