-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.04 KB
/
build.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
name: Build and Deploy
on:
push:
branches:
- main
- dev
permissions:
contents: read
id-token: write
jobs:
build_push:
environment: ${{ github.head_ref || github.ref_name }}
runs-on: ubuntu-latest
container:
image: node:20-alpine3.17
env:
AWS_BUCKET: ${{ vars.AWS_BUCKET }}
name: Build & deploy
steps:
- name: Checkout repository
uses: actions/checkout@v3
- 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: ${{ vars.AWS_DEFAULT_REGION }}
- name: Install dependencies
run: |
apk update
apk add --no-cache aws-cli
- name: NPM build
run: |
npm install --legacy-peer-deps
npm run build
- name: Sync website to S3
run: |
cd dist
aws s3 sync . s3://${AWS_BUCKET} --delete