Skip to content

Use next build and use the correct working directory #2

Use next build and use the correct working directory

Use next build and use the correct working directory #2

Workflow file for this run

name: Deploy
on:
push:
branches:
- main
jobs:
deploy-to-ipfs:
runs-on: ubuntu-latest
environment: mainnet
env:
NEXT_PUBLIC_TW_CLIENT_ID: bcb3b752494fc3e049a27c0cb7ce1702
steps:
- uses: actions/checkout@v3
with:
lfs: "true"
- name: Run install
uses: borales/actions-yarn@v4
with:
cmd: install
- uses: actions/cache@v4
with:
path: |
~/.pnpm
${{ github.workspace }}/.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- uses: actions/setup-node@v4
with:
node-version: 22.4.1
- run: next build
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_TOKEN }}
# update
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# update
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: out
# to enable Github Deployments
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: main
workingDirectory: .