added next build path #8
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: Pages | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write # Required to push to a branch | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| - run: npm install -g pnpm | |
| - run: pnpm install | |
| - run: pnpm run build | |
| - run: pnpm run export | |
| env: | |
| BASE_PATH: /tinymlhack2024-docs | |
| - name: List Files After Export | |
| run: ls -R out | |
| - name: Prepare for Deployment | |
| run: | | |
| mkdir -p deployment | |
| mv ./out/* ./deployment/ | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./deployment | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Download Build Artifact | |
| uses: actions/download-pages-artifact@v3 | |
| - name: Deploy to `page` Branch | |
| run: | | |
| git config user.name "GitHub Actions" | |
| git config user.email "[email protected]" | |
| git checkout --orphan page | |
| git rm -rf . | |
| cp -r ./deployment/* . | |
| git add . | |
| git commit -m "Deploy to page branch" | |
| git push -f origin page |