From 1bd71cc6655caf3e318676f08db318567c80babf Mon Sep 17 00:00:00 2001 From: stadolf Date: Sun, 8 Oct 2023 23:58:05 +0200 Subject: [PATCH] build & deploy to github pages uses yarn ci build adds gh secrets Signed-off-by: stadolf --- .github/workflows/builddeploy.yaml | 29 +++++++++++++++++++++++++++++ next.config.js | 1 + package.json | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/builddeploy.yaml diff --git a/.github/workflows/builddeploy.yaml b/.github/workflows/builddeploy.yaml new file mode 100644 index 0000000..87f9194 --- /dev/null +++ b/.github/workflows/builddeploy.yaml @@ -0,0 +1,29 @@ +name: Build and Deploy +on: + push: + branches: + - main +permissions: + contents: write +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + + - name: Install and Build + env: + NEXT_PUBLIC_PRIVY_APP_ID: ${{ secrets.NEXT_PUBLIC_PRIVY_APP_ID }} + NEXT_PUBLIC_WC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_WC_PROJECT_ID }} + NEXT_PUBLIC_INFURA_API_KEY: ${{ secrets.NEXT_PUBLIC_INFURA_API_KEY }} + run: | + yarn --frozen-lockfile + yarn build + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + folder: out # The folder the action should deploy. diff --git a/next.config.js b/next.config.js index a35bfad..aa1351e 100644 --- a/next.config.js +++ b/next.config.js @@ -1,6 +1,7 @@ /** @type {import('next').NextConfig} */ const nextConfig = { output: "export", + basePath: "/test-wagmi-safe-privy", }; module.exports = nextConfig; diff --git a/package.json b/package.json index 0884777..72791f7 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "dev": "next dev", "build": "next build", "start": "next start", - "lint": "next lint" + "lint": "next lint", + "deploy": "next build && touch out/.nojekyll && git add out/ && git commit -m \"Deploy\" && git subtree push --prefix out origin gh-pages" }, "dependencies": { "@chakra-ui/next-js": "^2.1.5",