From 70002aa0b1e8ac868d64d18c9c8f5a3fe60dab09 Mon Sep 17 00:00:00 2001 From: Jan Cibulka Date: Thu, 30 May 2024 18:16:55 +0300 Subject: [PATCH] Deploy to Github Pages --- .github/workflows/deploy.yml | 35 +++++++++++++++++++++++++++++++++++ frontend/.gitignore | 1 + frontend/next.config.js | 1 + frontend/package.json | 2 +- 4 files changed, 38 insertions(+), 1 deletion(-) 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..ffbcf49 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,35 @@ +name: Deploy Frontend to Github Pages + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install Frontend dependencies + run: | + cd frontend + npm install + + - name: Build Frontend Next.js website + run: | + cd frontend + npm run build + + - name: Deploy to GitHub Pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./frontend/out diff --git a/frontend/.gitignore b/frontend/.gitignore index 3055461..7d16caa 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -9,6 +9,7 @@ # next.js /.next /build +/out # secrets .env diff --git a/frontend/next.config.js b/frontend/next.config.js index 3877def..73f1410 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -6,4 +6,5 @@ module.exports = { reactStrictMode: true, swcMinify: true, + output: "export", }; diff --git a/frontend/package.json b/frontend/package.json index 1447850..ac14ee5 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -7,7 +7,7 @@ "private": true, "scripts": { "dev": "next dev -p 4001", - "build": "next build", + "build": "next build && next export", "start": "next start", "lint": "next lint", "compile-contract-types": "typechain --target ethers-v5 --out-dir contracts/types './contracts/*.json'",