-
Notifications
You must be signed in to change notification settings - Fork 42
50 lines (41 loc) · 1.51 KB
/
pr-preview.yml
File metadata and controls
50 lines (41 loc) · 1.51 KB
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
name: PR Preview
on:
pull_request:
jobs:
main:
name: Build and Deploy Storybook
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup pnpm
uses: pnpm/action-setup@v5
- name: Setup Node
uses: actions/setup-node@v6
with:
node-version-file: '.nvmrc'
cache: pnpm
- name: Install dependencies
run: pnpm run ci:deps
- name: Build Storybook
run: pnpm run ci:demo:build
- name: Upload to S3
uses: gravity-ui/preview-upload-to-s3-action@v1
with:
src-path: demo/storybook-static
dest-path: /md-editor/pulls/${{ github.event.pull_request.number }}/
s3-key-id: ${{ secrets.STORYBOOK_S3_KEY_ID }}
s3-secret-key: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
- name: Create token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ secrets.GRAVITY_UI_APP_ID }}
private-key: ${{ secrets.GRAVITY_UI_APP_PRIVATE_KEY }}
- name: Create Comment
uses: marocchino/sticky-pull-request-comment@v3
with:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
header: preview
number: ${{ github.event.pull_request.number }}
message: '[](https://preview.gravity-ui.com/md-editor/${{ github.event.pull_request.number }}/)'