Skip to content

Commit

Permalink
feat: add PR preview workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
adamviktora committed Oct 7, 2024
1 parent e6d2afd commit 0fa064e
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: pr-preview
on: pull_request_target
jobs:
build-upload:
runs-on: ubuntu-latest
env:
SURGE_LOGIN: ${{ secrets.SURGE_LOGIN }}
SURGE_TOKEN: ${{ secrets.SURGE_TOKEN }}
GH_PR_TOKEN: ${{ secrets.GH_PR_TOKEN }}
GH_PR_NUM: ${{ github.event.number }}
steps:
- uses: actions/checkout@v4
# Yes, we really want to checkout the PR
- run: |
git fetch origin pull/$GH_PR_NUM/head:tmp
git checkout tmp
- run: |
git rev-parse origin/main
git rev-parse HEAD
git rev-parse origin/main..HEAD
git log origin/main..HEAD --format="%b"
# Yes, we really want to checkout the PR
# Injected by generate-workflows.js
- uses: actions/setup-node@v4
with:
node-version: '20'
- uses: actions/cache@v4
id: npm-cache
name: Load npm deps from cache
with:
path: '**/node_modules'
key: ${{ runner.os }}-yarn-cache-${{ hashFiles('yarn.lock') }}
- run: yarn install --frozen-lockfile
if: steps.yarn-cache.outputs.cache-hit != 'true'
- run: yarn build
name: Build AI infra ui components
- uses: actions/cache@v4
id: docs-cache
name: Load webpack cache
with:
path: '.cache'
key: ${{ runner.os }}-v4-${{ hashFiles('yarn.lock') }}

- run: yarn build:docs
name: Build docs
- run: node .github/upload-preview.js packages/module/public
name: Upload docs
if: always()
- run: yarn serve:docs & yarn test:a11y
name: a11y tests
- run: node .github/upload-preview.js packages/module/coverage
name: Upload a11y report
if: always()

0 comments on commit 0fa064e

Please sign in to comment.