Skip to content

chore(docs): Remove papers #148

chore(docs): Remove papers

chore(docs): Remove papers #148

name: Preview Deploy for Explorer
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.EXPLORER_VERCEL_PROJECT_ID }}
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- "apps/explorer/**"
- ".github/workflows/apps-explorer-preview.deploy.yml"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
deploy-preview:
permissions:
contents: read
pull-requests: write
runs-on: [self-hosted]
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2 # [email protected]
- name: Install Nodejs
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # [email protected]
with:
node-version: "20"
cache: "pnpm"
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Turbo Cache
id: turbo-cache
uses: actions/cache@v3
with:
path: node_modules/.cache/turbo
key: turbo-${{ runner.os }}-${{ github.sha }}
restore-keys: |
turbo-${{ runner.os }}-
- name: Install Vercel CLI
run: pnpm add --global vercel@canary
- name: Pull Vercel Env variables (network configs)
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }}
- name: Copy the .env file
run: cp ./.vercel/.env.preview.local ./sdk/.env
- name: Build Explorer
run: pnpm explorer build
- name: Build Project Artifacts
run: vercel build --token=${{ secrets.VERCEL_TOKEN }}
- name: Deploy Project Artifacts to Vercel
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > vercel_output.txt
- name: Extract Deploy URL
id: deploy_url
run: echo "DEPLOY_URL=$(cat vercel_output.txt | awk 'END{print}')" >> $GITHUB_OUTPUT
- name: Comment on pull request
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const DEPLOY_URL = '${{ steps.deploy_url.outputs.DEPLOY_URL }}'
const COMMIT_SHA = '${{ github.event.pull_request.head.sha }}'
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `This pull request has been deployed to Vercel.\n\n\nLatest commit: ${COMMIT_SHA}\n\n:white_check_mark: Preview: ${DEPLOY_URL}`
})