-
Notifications
You must be signed in to change notification settings - Fork 26
59 lines (50 loc) · 1.54 KB
/
docs.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
57
58
59
name: Docs
on:
push:
branches:
- main
paths:
- "docs/**"
- ".github/workflows/docs.yaml"
pull_request:
branches:
- main
paths:
- "docs/**"
- ".github/workflows/docs.yaml"
types: [opened, reopened, synchronize, ready_for_review]
jobs:
deploy:
if: github.event_name != 'pull_request' || !github.event.pull_request.draft
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: node
uses: actions/setup-node@v3
with:
node-version: 18.4.0
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.DOCS_AWS_ACCESS_KEY_ID }}
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/
shell: bash
- name: Dependencies
run: cd docs/ && yarn
- name: Build docs
run: cd docs/ && yarn run export
- name: Deploy
if: github.ref == 'refs/heads/main'
run: |
aws s3 sync docs/out/ s3://starship.cosmology.tech
aws cloudfront create-invalidation --distribution-id E1LIY8AZD4EEQD --paths "/*"
cd docs/ && ./seo/prepare.sh