-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (45 loc) · 1.5 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
50
51
52
53
54
55
56
name: Build and Deploy Docs
on:
push:
branches:
- main
pull_request:
types: [opened, reopened]
workflow_dispatch:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository 🛎️
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'yarn'
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.DOCS_AWS_ACCESS_KEY }}
aws-secret-access-key: ${{ secrets.DOCS_AWS_SECRET_ACCESS_KEY }}
aws-region: 'us-east-1'
- name: Install AWS CLI v2
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip
unzip -q /tmp/awscliv2.zip -d /tmp
rm /tmp/awscliv2.zip
sudo /tmp/aws/install --update
rm -rf /tmp/aws/
- 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'
run: yarn deploy:ci
- name: Invalidate CloudFront
if: github.ref == 'refs/heads/main' || github.event_name != 'pull_request'
run: yarn invalidate:ci
- name: Prepare seo
if: github.ref == 'refs/heads/main' || github.event_name != 'pull_request'
run: bash ./seo/prepare.sh