-
Notifications
You must be signed in to change notification settings - Fork 17
45 lines (36 loc) · 1.11 KB
/
deploy_storybook.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
name: Deploy storybook to bucket
on:
push:
branches:
- dev
env:
S3_BUCKET: s3://spektr-storybook
STORING_DAYS: 180
jobs:
deploy-to-bucket:
runs-on: macos-12
steps:
- name: Checkout
uses: actions/checkout@v4
- name: ⚙️ Install dependencies
uses: ./.github/workflows/install-pnpm
- name: ⚙️ Install s3cmd
uses: ./.github/workflows/setup-s3cmd
with:
s3_region: nl-ams
s3_access_key: ${{ secrets.S3_ACCESS_KEY }}
s3_secret_key: ${{ secrets.S3_SECRET_KEY }}
- name: Build app
run: |
pnpm storybook:build
- name: List available S3 buckets
run: s3cmd ls
- name: Interact with object storage
id: interact_with_storage
run: |
base_directory="release/storybook"
destination_s3="${{ env.S3_BUCKET }}"
find "$base_directory" -type f | while read -r file; do
relative_path="${file#$base_directory/}" # Extract the relative path
s3cmd sync "$file" "${destination_s3}/${relative_path}" --acl-public
done