-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.2 KB
/
deploy-frontend.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
name: Build and deploy frontend
on:
push:
branches: [main]
pull_request:
branches: [ main ]
jobs:
build-test-deploy:
name: Tests
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./social-media-app
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
with:
version: 7
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'pnpm'
cache-dependency-path: ./social-media-app/pnpm-lock.yaml
- name: Injecting environment variables
run: echo "REACT_APP_API_URL=${{ secrets.API_URL }}" >> .env
- name: Installing dependencies
run: pnpm install
- name: Running tests
run: pnpm test
- name: Building project
run: pnpm build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-north-1
- name: Deploy to S3 bucket
run: aws s3 sync ./build/ s3://postagramapi --delete