From 5d2be03053c79993a642ff7ab8a7346c9194043b Mon Sep 17 00:00:00 2001 From: vi Date: Sat, 6 Jan 2024 08:56:51 +0000 Subject: [PATCH] [tuanm] deploy via github actions --- .github/workflows/deploy.yml | 33 +++++++++++++++++++++++++++++++++ next.config.js | 1 + package.json | 1 + 3 files changed, 35 insertions(+) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..48ef70e --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,33 @@ +name: deploy v2 + +on: + push: + branches: [v2-main] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2.3.1 + + - name: Setup Node + uses: actions/setup-node@v1 + with: + node-version: '18.x' + + - name: Install dependencies + run: yarn install + + - name: Build + run: echo "NEXT_PUBLIC_SERVER_BASE_URL=$NEXT_PUBLIC_SERVER_BASE_URL" > .env && yarn build && yarn export && touch ./build/.nojekyll + env: + NEXT_PUBLIC_SERVER_BASE_URL: ${{ vars.NEXT_PUBLIC_SERVER_BASE_URL }} + + - name: Deploy to GitHub Pages + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: deploy/v2 + FOLDER: build diff --git a/next.config.js b/next.config.js index 0ebdaca..cfcb4de 100644 --- a/next.config.js +++ b/next.config.js @@ -1,3 +1,4 @@ module.exports = { + basePath: '/documentizer', output: 'standalone', }; \ No newline at end of file diff --git a/package.json b/package.json index 754b282..d1e258f 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "dev": "next", "start": "next start", "build": "next build", + "export": "next export -o build", "format": "prettier --write 'src/**/*.{js,ts,tsx,scss,css}'", "format:staged": "pretty-quick --pattern 'src/**/*.{js,ts,tsx,scss,css}' --staged" },