You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by ju...@apache.org on 2021/09/23 02:35:27 UTC
[apisix-website] branch master updated: feat: add vercel preview
(#602)
This is an automated email from the ASF dual-hosted git repository.
juzhiyuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-website.git
The following commit(s) were added to refs/heads/master by this push:
new 5a2cfad feat: add vercel preview (#602)
5a2cfad is described below
commit 5a2cfadc18c972a495f65e685b68eb9c8612d04a
Author: bzp2010 <bz...@apache.org>
AuthorDate: Wed Sep 22 21:35:20 2021 -0500
feat: add vercel preview (#602)
---
.github/workflows/preview.yml | 52 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml
new file mode 100644
index 0000000..48b7365
--- /dev/null
+++ b/.github/workflows/preview.yml
@@ -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