Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(website): allow preview of website changes #12966

Merged
merged 39 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
0ea0b2b
Update website.yml
dantaik Jan 18, 2023
180f31f
more
dantaik Jan 18, 2023
0f0a59f
Update website_preview.yml
dantaik Jan 18, 2023
6380450
Update website_preview.yml
dantaik Jan 18, 2023
c9ce732
Update website_preview.yml
dantaik Jan 18, 2023
f75b154
Update website_preview.yml
dantaik Jan 18, 2023
4ec688e
Update website_preview.yml
dantaik Jan 18, 2023
d21efdf
Update website_preview.yml
dantaik Jan 18, 2023
5326de2
Update website_preview.yml
dantaik Jan 18, 2023
fdc1bad
Update website_preview.yml
dantaik Jan 18, 2023
c2f384e
Update website_build.yml
dantaik Jan 18, 2023
33b1429
aaaaaa
dantaik Jan 18, 2023
c305a60
Update website_preview.yml
dantaik Jan 18, 2023
654db7f
Update website_preview.yml
dantaik Jan 18, 2023
b264b6e
Update website_preview.yml
dantaik Jan 18, 2023
461efe8
Update website_preview.yml
dantaik Jan 18, 2023
179d42d
Update website_preview.yml
dantaik Jan 18, 2023
4a98a8e
Update website_preview.yml
dantaik Jan 18, 2023
7dcced6
Update website_preview.yml
dantaik Jan 18, 2023
4bba39d
Update website_preview.yml
dantaik Jan 18, 2023
a80e002
Update website_preview.yml
dantaik Jan 18, 2023
f335c25
Update website_preview.yml
dantaik Jan 18, 2023
737a05d
Update website_preview.yml
dantaik Jan 18, 2023
cb585b9
Update website_preview.yml
dantaik Jan 18, 2023
539c25f
Update website_preview.yml
dantaik Jan 18, 2023
92bfb00
Update website_preview.yml
dantaik Jan 18, 2023
bfa797d
Update website_preview.yml
dantaik Jan 18, 2023
d74aa15
Update website_preview.yml
dantaik Jan 18, 2023
25a4a61
Update website_preview.yml
dantaik Jan 18, 2023
529533e
Update website_preview.yml
dantaik Jan 18, 2023
63da10e
Update website_preview.yml
dantaik Jan 18, 2023
e80deb3
Update .github/workflows/website_preview.yml
dantaik Jan 18, 2023
c983927
Update .github/workflows/website_preview.yml
dantaik Jan 18, 2023
101d3ab
Merge branch 'main' into website_vercel_preview
dantaik Jan 18, 2023
120fa16
Update website_preview.yml
dantaik Jan 18, 2023
f033d2f
Update website_preview.yml
dantaik Jan 18, 2023
922c17f
Update website_preview.yml
dantaik Jan 18, 2023
579c375
Update website_preview.yml
dantaik Jan 18, 2023
00d3265
Update website_preview.yml
dantaik Jan 18, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Website
name: Website Build

on:
push:
Expand Down Expand Up @@ -50,3 +50,4 @@ jobs:

- name: Build Website
run: pnpm -F website build

57 changes: 57 additions & 0 deletions .github/workflows/website_preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Website Preview
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_WEBSITE_PROJECT_ID }}
on:
pull_request:
types:
- opened
- reopened
- edited
paths:
- "packages/website/**"
jobs:
vercel-preview:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout repository
uses: actions/checkout@v3

- name: Set up protocol
uses: ./.github/actions/set-up-protocol

- 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
run: vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }} > url.txt

- name: Get Preview URL
id: get-url
run: echo ::set-output name=url::$(cat url.txt)

- name: Test output
run: echo ${{ steps.get-url.outputs.url }}

- name: Create Preview Comment
uses: actions/github-script@v5
with:
github-token: ${{ github.token }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '☂️☂️☂️ Preview the changes at: ${{ steps.get-url.outputs.url }}'
})
2 changes: 1 addition & 1 deletion .github/workflows/whitepaper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
paths:
- "packages/whitepaper/**"
jobs:
build_latex:
build-latex:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
Expand Down