-
Notifications
You must be signed in to change notification settings - Fork 5
49 lines (40 loc) · 1.24 KB
/
deploy.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
40
41
42
43
44
45
46
47
48
49
name: Build and Deploy Docs
on:
push:
branches:
- main
pull_request:
types: [opened, reopened]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
defaults:
run:
working-directory: .
steps:
- name: Checkout Repository 🛎️
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Install Dependencies
run: yarn install
- name: Build Project
run: yarn export
- name: Deploy to S3
if: github.ref == 'refs/heads/main' || github.event_name != 'pull_request'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-1'
run: yarn deploy:ci
- name: Invalidate CloudFront
if: github.ref == 'refs/heads/main' || github.event_name != 'pull_request'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: 'us-east-1'
run: yarn invalidate:ci