chore(docs): fix solvernet problem section #49
Workflow file for this run
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: ci pr docs | |
env: | |
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | |
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_DOCS_PROJECT_ID }} | |
on: | |
pull_request: | |
paths: | |
- 'docs/**' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
outputs: | |
url: ${{ steps.deploy.outputs.deployment_url }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Install PNPM | |
uses: pnpm/action-setup@v4 | |
with: | |
version: 8 | |
- name: Install Vercel CLI | |
run: pnpm install --global vercel@latest | |
- name: Pull Vercel Environment Information | |
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Build Project Artifacts | |
run: vercel build --token=${{ secrets.VERCEL_TOKEN }} | |
- name: Deploy Project Artifacts to Vercel | |
id: deploy | |
run: echo "deployment_url=$(vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" >> $GITHUB_OUTPUT | |
comment: | |
needs: deploy | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
issues: write | |
pull-requests: write | |
steps: | |
- name: Comment PR with Deployment URL | |
uses: actions/github-script@v7 | |
with: | |
github-token: ${{secrets.GITHUB_TOKEN}} | |
script: | | |
const deployment_url = '${{ needs.deploy.outputs.url }}'; | |
const pr_number = context.payload.pull_request.number; | |
const repository = context.repo.repo; | |
const owner = context.repo.owner; | |
github.rest.issues.createComment({ | |
owner: owner, | |
repo: repository, | |
issue_number: pr_number, | |
body: `Docs preview complete 🚀 see it here: ${deployment_url}` | |
}); |