Merge pull request #92 from nnn-training/zen-study #97
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: deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js 20.9.0 | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.9.0 | |
cache: 'yarn' | |
- name: Cache Next.js build | |
uses: actions/cache@v4 | |
with: | |
path: ${{ github.workspace }}/.next/cache | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | |
restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/yarn.lock') }}- | |
- name: install | |
run: | | |
yarn install | |
- name: build | |
run: | | |
yarn build | |
env: | |
NEXT_PUBLIC_GITHUB_PAGES: true | |
- name: generate sitemap | |
run: | | |
npx next-sitemap | |
- name: Create .nojekyll | |
run: | | |
touch out/.nojekyll | |
- name: deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./out |