diff --git a/.github/workflows/website.yml b/.github/workflows/website_build.yml similarity index 98% rename from .github/workflows/website.yml rename to .github/workflows/website_build.yml index 1fb4cb3c838..0fb96324451 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website_build.yml @@ -1,4 +1,4 @@ -name: Website +name: Website Build on: push: @@ -50,3 +50,4 @@ jobs: - name: Build Website run: pnpm -F website build + diff --git a/.github/workflows/website_preview.yml b/.github/workflows/website_preview.yml new file mode 100644 index 00000000000..28c35ac1e4a --- /dev/null +++ b/.github/workflows/website_preview.yml @@ -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/cancel-workflow-action@0.11.0 + 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 }}' + }) diff --git a/.github/workflows/whitepaper.yml b/.github/workflows/whitepaper.yml index 41351fb14e6..a478865c66d 100644 --- a/.github/workflows/whitepaper.yml +++ b/.github/workflows/whitepaper.yml @@ -8,7 +8,7 @@ on: paths: - "packages/whitepaper/**" jobs: - build_latex: + build-latex: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs