-
Notifications
You must be signed in to change notification settings - Fork 6
49 lines (47 loc) · 1.76 KB
/
push_to_next.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
49
name: Build & push Storybook & Prez UI demo site to AWS
on:
push:
branches:
- hjohns/next/widgets
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm & install workspace
uses: pnpm/action-setup@v3
with:
version: latest
run_install: true
- name: Build prez-lib
working-directory: ./prez-lib
run: CI=false pnpm build
- name: Build prez-components
working-directory: ./prez-components
run: CI=false pnpm build
- name: Build Storybook
working-directory: ./prez-components
run: CI=false pnpm build-storybook
- name: Build prez-ui
working-directory: ./prez-ui
env:
NUXT_PUBLIC_API_URL: ${{ secrets.NEXT_WIDGETS_API_URL }}
run: CI=false pnpm generate
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-southeast-2
- name: Clear Storybook S3 bucket
run: aws s3 rm s3://${{ secrets.NEXT_WIDGETS_STORYBOOK_S3_BUCKET_NAME }} --recursive
- name: Upload Storybook to S3
working-directory: ./prez-components
run: aws s3 cp storybook-static/ s3://${{ secrets.NEXT_WIDGETS_STORYBOOK_S3_BUCKET_NAME }} --recursive
- name: Clear Prez UI S3 bucket
run: aws s3 rm s3://${{ secrets.NEXT_WIDGETS_PREZUI_S3_BUCKET_NAME }} --recursive
- name: Upload Prez UI to S3
working-directory: ./prez-ui
run: aws s3 cp dist/ s3://${{ secrets.NEXT_WIDGETS_PREZUI_S3_BUCKET_NAME }} --recursive