Skip to content

feat(enhanced-readabilities): added new options to allow users to customize their desired width of the layout #23

feat(enhanced-readabilities): added new options to allow users to customize their desired width of the layout

feat(enhanced-readabilities): added new options to allow users to customize their desired width of the layout #23

name: Build Preview Docs to Netlify
on:
pull_request:
branches:
- main
jobs:
build:
name: Build
permissions:
pull-requests: write
runs-on: ubuntu-22.04
steps:
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: to Netlify
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## 🚧 Deploying to Netlify
| Status | URL |
|-------------|--------------------------------------|
| Pending | `URL will be revealed once deployed` |
edit-mode: replace
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node.js 20.x
uses: actions/setup-node@v3
with:
node-version: 20.x
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
run_install: false
version: 8
- name: Obtain pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Obtain pnpm store cache
uses: actions/cache@v3
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build docs
run: |
pnpm packages:build
pnpm docs:build
- name: Install Netlify CLI
run: pnpm install -g netlify-cli
- name: Push to Netlify
id: netlify
timeout-minutes: 10
working-directory: docs/
run: |
NETLIFY_JSON_OUTPUT=$(netlify deploy --dir .vitepress/dist --json)
echo $NETLIFY_JSON_OUTPUT
echo "NETLIFY_JSON_OUTPUT=$(echo $NETLIFY_JSON_OUTPUT)" >> $GITHUB_ENV
echo "NETLIFY_URL=$(echo $NETLIFY_JSON_OUTPUT | jq -r .deploy_url)" >> $GITHUB_ENV
cat $GITHUB_ENV
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v3
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
## ✅ Deployed to Netlify
| Status | URL |
|-------------|-----------------------------------------------------|
| Success | ${{ env.NETLIFY_URL }} |
edit-mode: replace