Skip to content

Commit

Permalink
feat: add vercel preview (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
bzp2010 authored Sep 23, 2021
1 parent af780f3 commit 5a2cfad
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Preview Pull Request

on:
push:
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Node.js environment
uses: actions/setup-node@v2.4.0
with:
node-version: 14.x

- name: Install Dependencies
run: |
cd scripts && yarn install
cd ../website && yarn install
- name: Sync documents
run: |
cd scripts && yarn sync && git status
- name: Build
run: |
cd website && yarn build
cp ../.asf.yaml ./build
- name: Compress build artifacts
run: |
mkdir artifact && cd artifact
tar cvzf - ../website/build | split -d -b 90m - website
- name: Archive artifacts to GitHub
uses: actions/upload-artifact@v2
with:
name: artifact.zip
path: artifact
retention-days: 5

- name: Deploy Preview
uses: amondnet/vercel-action@v20
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
working-directory: artifact

0 comments on commit 5a2cfad

Please sign in to comment.