-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (74 loc) · 2.33 KB
/
deploy-preview.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: deploy-preview
on:
workflow_call:
pull_request:
types:
- opened
- synchronize
jobs:
test:
uses: ./.github/workflows/test.yml
smart-camera-web:
needs:
- test
defaults:
run:
working-directory: ./packages/smart-camera-web
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set node version
uses: actions/setup-node@v3
- name: install dependencies
run: npm ci
- name: build application
run: npm run build
- name: set destination directory
id: set_dest_dir_smart_camera_web
run: >-
echo "DEST_DIR_SMART_CAMERA_WEB=js/preview-$GITHUB_HEAD_REF" >>
"$GITHUB_ENV"
- name: deploy preview to s3
uses: jakejarvis/[email protected]
with:
args: >-
--follow-symlinks --delete --exclude '*' --include
'smart-camera-web.js'
env:
AWS_S3_BUCKET: '${{ secrets.AWS_S3_BUCKET }}'
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
AWS_REGION: '${{ secrets.AWS_REGION }}'
SOURCE_DIR: ./packages/smart-camera-web
DEST_DIR: '${{ env.DEST_DIR_SMART_CAMERA_WEB }}'
embed:
needs:
- test
defaults:
run:
working-directory: ./packages/embed
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v4
- name: set node version
uses: actions/setup-node@v3
- name: install dependencies
run: npm ci
- name: build application
run: 'npm run build && npm run build:dist'
- name: set destination directory
id: set_dest_dir_hosted_web
run: echo "DEST_DIR_EMBED=inline/preview-$GITHUB_HEAD_REF" >> "$GITHUB_ENV"
- name: deploy preview to s3
uses: jakejarvis/[email protected]
with:
args: '--follow-symlinks --delete'
env:
AWS_S3_BUCKET: '${{ secrets.AWS_S3_BUCKET }}'
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
AWS_REGION: '${{ secrets.AWS_REGION }}'
SOURCE_DIR: ./packages/embed/dist
DEST_DIR: '${{ env.DEST_DIR_EMBED }}'