next.js 应用程序目录的 GitHub 操作 CI/CD 路径

huangapple go评论58阅读模式
英文:

next js app directory github action CI/CD path

问题

I'm currently trying to deploy from the app directory to Github Action CI/CD.
But I keep getting a PageNotFoundError: Cannot find module for page: / error, and I think the phenomenon that I can't read the app path in my structure is happening. Below is the next.config.js file. Is there something I'm missing?

next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    appDir: true,
  },
};

module.exports = nextConfig;

nextjs.yml

Is there something I am doing wrong?

name: git push into another repo to deploy to vercel

on:
  push:
    branches: master

jobs:
  build:
    runs-on: ubuntu-latest
    container: pandoc/latex
    steps:
      - uses: actions/checkout@v2
      - name: Install mustache (to update the date)
        run: apk add ruby && gem install mustache
      - name: creates output
        run: sh ./build.sh
      - name: Pushes to another repository
        id: push_directory
        uses: cpina/github-action-push-to-another-repository@main
        env:
          API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
        with:
          source-directory: 'output'
          destination-github-username: [Seung-hwan285]
          destination-repository-name: [Team-PODO-ODEEGO-FE]
          user-email: ${{ secrets.OFFICIAL_ACCOUNT_EMAIL }}
          commit-message: ${{ github.event.commits[0].message }}
          target-branch: main
      - name: Test get variable exported by push-to-another-repository
        run: echo $DESTINATION_CLONED_DIRECTORY
英文:

I'm currently trying to deploy from the app directory to Github Action CI/CD.
But I keep getting a PageNotFoundError: Cannot find module for page: / error, and I think the phenomenon that I can't read the app path in my structure is happening. Below is the next.config.js file. Is there something I'm missing?

next.js 应用程序目录的 GitHub 操作 CI/CD 路径

next.js 应用程序目录的 GitHub 操作 CI/CD 路径

next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    appDir: true,
  },
};

module.exports = nextConfig;

nextjs.yml

Is there something I am doing wrong?

name: git push into another repo to deploy to vercel

on:
  push:
    branches: master

jobs:
  build:
    runs-on: ubuntu-latest
    container: pandoc/latex
    steps:
      - uses: actions/checkout@v2
      - name: Install mustache (to update the date)
        run: apk add ruby && gem install mustache
      - name: creates output
        run: sh ./build.sh
      - name: Pushes to another repository
        id: push_directory
        uses: cpina/github-action-push-to-another-repository@main
        env:
          API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }}
        with:
          source-directory: 'output'
          destination-github-username: [Seung-hwan285]
          destination-repository-name: [Team-PODO-ODEEGO-FE
]
          user-email: ${{ secrets.OFFICIAL_ACCOUNT_EMAIL }}
          commit-message: ${{ github.event.commits[0].message }}
          target-branch: main
      - name: Test get variable exported by push-to-another-repository
        run: echo $DESTINATION_CLONED_DIRECTORY

答案1

得分: 2

这个功能现在在 Next 13.3 中得到支持。

更多信息,请查看:https://beta.nextjs.org/docs/app-directory-roadmap#configuration

英文:

This feature now is supported in Next 13.3

For more information, checkout: <https://beta.nextjs.org/docs/app-directory-roadmap#configuration>

答案2

得分: 0

抱歉,next export 不支持实验性的 appDir 设置。

更多信息,请查看:https://beta.nextjs.org/docs/app-directory-roadmap

英文:

Unfortunately, next export does not support the experimental appDir setting.

For more information, checkout: https://beta.nextjs.org/docs/app-directory-roadmap

huangapple
  • 本文由 发表于 2023年2月19日 12:54:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75498086.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定