-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (50 loc) · 1.36 KB
/
deploy-storybook-aws.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
55
56
57
58
59
name: Deploy Storybook to AWS S3
on:
push:
branches:
- main
env:
AWS_DEFAULT_REGION: eu-west-1
AWS_ASSUME_ROLE_ARN: arn:aws:iam::782102975611:role/OGCIO_GitHub_WebIdentity
AWS_S3_BUCKET_NAME: www-storybook-design-system-gov-ie
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.x'
- run: npm i
- run: npm run build:storybook:dist
- run: npm run storybook:build
- name: Upload artifact
uses: actions/upload-artifact@v3.1.2
with:
name: build-artifact
path: build
deploy:
name: Deploy to Amazon S3
runs-on: ubuntu-latest
needs: build
permissions:
id-token: write
contents: read
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifact
uses: actions/download-artifact@v3.0.2
with:
name: build-artifact
path: build
- name: AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{env.AWS_ASSUME_ROLE_ARN}}
role-duration-seconds: 900
aws-region: ${{env.AWS_DEFAULT_REGION}}
- name: Deploy to S3
run: aws s3 sync build/ s3://$AWS_S3_BUCKET_NAME/