-
-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yossydev
committed
Dec 3, 2023
1 parent
86d8f8b
commit 6c73bdf
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Website preview | ||
env: | ||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
# Cancel jobs when the PR is updated | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
jobs: | ||
preview-deploy: | ||
runs-on: ubuntu-latest | ||
environment: Website deployment | ||
# Check if the event is not triggered by a fork | ||
if: github.event.pull_request.head.repo.full_name == github.repository | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- name: Cache pnpm modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.pnpm-store | ||
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}- | ||
- uses: pnpm/action-setup@v2.2.4 | ||
with: | ||
version: 8 | ||
- name: Install toolchain | ||
uses: moonrepo/setup-rust@v1 | ||
- name: Install wasm-pack | ||
uses: jetli/wasm-pack-action@v0.4.0 | ||
with: | ||
version: 'latest' | ||
- name: Install Vercel CLI | ||
run: npm install --global vercel@latest | ||
- name: Pull Vercel Environment Information | ||
working-directory: website | ||
run: vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | ||
- name: Build WASM module for the web | ||
run: wasm-pack build --out-dir ../../packages/@biomejs/wasm-web --target web --scope biomedev crates/biome_wasm | ||
- name: Install libraries | ||
working-directory: website | ||
run: pnpm i | ||
- name: Build JS | ||
working-directory: website | ||
run: pnpm build:js | ||
- name: Run textlint | ||
working-directory: website | ||
run: pnpm textlint | ||
- name: Deploy Project Artifacts to Vercel | ||
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} | ||
working-directory: website |