Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add/ config CI.CD for publising on Github Pages #5

Open
pnguyen215 opened this issue Jul 20, 2024 · 0 comments
Open

Add/ config CI.CD for publising on Github Pages #5

pnguyen215 opened this issue Jul 20, 2024 · 0 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@pnguyen215
Copy link
Owner

pnguyen215 commented Jul 20, 2024

How to Deploy Next.js Apps to Github Pages

name: Deploy to GitHub Pages

on:
  push:
    branches:
      - main

jobs:
  build-and-deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Set up Node.js
        uses: actions/setup-node@v2
        with:
          node-version: '16'

      - name: Install dependencies
        run: pnpm install

      - name: Build project
        env:
          NEXT_PUBLIC_BASE_PATH: "/your-repo-name"
          NEXT_PUBLIC_PAGE_EXTENSIONS: "js,jsx,ts,tsx,md,mdx"
          NEXT_PUBLIC_OUTPUT: "export"
          NEXT_PUBLIC_TS_IGNORE_BUILD_ERRORS: "true"
          NEXT_PUBLIC_ESLINT_IGNORE_DURING_BUILDS: "true"
          NEXT_PUBLIC_REACT_STRICT_MODE: "true"
        run: pnpm build

      - name: Deploy to GitHub Pages
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./out
@pnguyen215 pnguyen215 added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 20, 2024
@pnguyen215 pnguyen215 self-assigned this Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant