-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (42 loc) · 1.26 KB
/
s3.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
name: Upload on AWS S3
on:
push:
branches:
- main
paths:
- "client/**"
defaults:
run:
working-directory: "client"
jobs:
build:
runs-on: ubuntu-latest
environment: production
env:
REACT_APP_API_URL: ${{ vars.REACT_APP_API_URL }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install Dependencies
run: npm install
- name: Checking version
run: node --version
- name: Test env
run: echo "$REACT_APP_API_URL"
- name: Create build
run: npm run build
- name: Save AWS Credentials
run: |
echo "AWS_ACCESS_KEY_ID=${{ secrets.ACCESS_KEY }}" >> "$GITHUB_ENV"
echo "AWS_SECRET_ACCESS_KEY=${{ secrets.SECRET_ACCESS_KEY }}" >> "$GITHUB_ENV"
echo "AWS_REGION=us-east-1" >> "$GITHUB_ENV"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v3
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Upload to S3
run: aws s3 sync ./build s3://video-hub-terraform --delete