-
Notifications
You must be signed in to change notification settings - Fork 6
54 lines (47 loc) · 1.53 KB
/
preview-and-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: "Vercel Preview and Storybook Test"
on:
pull_request:
workflow_dispatch:
env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
jobs:
preview:
name: Preview and Test
env:
vercel_token: ${{ secrets.VERCEL_TOKEN }}
runs-on: ubuntu-latest
environment:
name: Storybook Preview
url: ${{ steps.deploy.outputs.url }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set Up Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: yarn
- name: Install
run: |
cd ${{ github.workspace }}
yarn install --immutable
- name: Lint
run: |
yarn lint-all
# These steps don't work unless a repository owner opened the PR
- name: Deploy
if: ${{ env.vercel_token != '' }}
run: |
yarn vercel pull --yes --token=${{ secrets.VERCEL_TOKEN }}
yarn vercel build --token=${{ secrets.VERCEL_TOKEN }}
yarn vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}
- id: deploy
if: ${{ env.vercel_token != '' }}
run: echo "url=$(yarn vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }})" >> "$GITHUB_OUTPUT"
- name: Storybook Test
if: ${{ env.vercel_token != '' }}
run: |
yarn workspace qwik-app playwright install --with-deps && yarn workspace qwik-app test-storybook
env:
TARGET_URL: "${{ steps.deploy.outputs.url }}"