Deploy IPFS #422
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Deploy IPFS | |
on: | |
push: | |
branches: | |
- development | |
paths: | |
- 'web/**' | |
workflow_run: | |
workflows: ["Playwright E2E Tests", "Jest Unit Tests"] | |
types: | |
- completed | |
jobs: | |
deploy-to-ipfs: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
environment: mainnet | |
env: | |
NEXT_PUBLIC_LONGTAIL_GRAPHQL_URL: https://testnet-graph.long.so | |
NEXT_PUBLIC_LONGTAIL_WALLETCONNECT_PROJECT_ID: bf05d5b47c6d5a47c0de300dc3b80f70 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
lfs: "true" | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 8 | |
run_install: | | |
- recursive: true | |
- 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: 20.15.0 | |
- run: | | |
cd web | |
pnpm 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_APP_PROJECT_NAME }} | |
directory: out | |
# to enable Github Deployments | |
gitHubToken: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
workingDirectory: web |