-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (46 loc) · 1.7 KB
/
2-publish_storybook_pr.yaml
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
name: Publish Storybook for PR
on:
pull_request:
types: [opened, ready_for_review, synchronize, labeled]
jobs:
publish-storybook:
name: Build & Publish Storybook
if: contains(github.event.pull_request.labels.*.name, 'publish-preview')
runs-on: ubuntu-latest
env:
working-directory: ./packages/sdk-react
pr_number: ${{ github.event.pull_request.number }}
S3_BUCKET: ${{ secrets.S3_BUCKET }}
S3_KEY: ${{ secrets.S3_KEY }}
INTERNAL_DOCS_URL: ${{ secrets.INTERNAL_DOCS_URL }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.CITYMAPPER_DOCS_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CITYMAPPER_DOCS_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
role-to-assume: ${{ secrets.CITYMAPPER_DOCS_AWS_ROLE_TO_ASSUME }}
role-external-id: ${{ secrets.CITYMAPPER_DOCS_AWS_ROLE_EXTERNAL_ID }}
role-duration-seconds: 900
# Storybook build requires node
- name: Setup Node 16
uses: actions/setup-node@v3
with:
node-version: '16'
# AWS CLI requires Python
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install AWS CLI
run: pip install awscli
- name: Install Node Packages
run: yarn install --frozen-lockfile
- name: Build and upload docs to citymapper-docs bucket
run: ./scripts/publish-storybook.sh $pr_number
working-directory: ${{env.working-directory}}