This repository has been archived by the owner on Jun 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
54 lines (47 loc) · 1.63 KB
/
prod.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
50
51
52
53
54
name: klaytn-docs-docusaurus prod deploy workflow
on:
push:
branches:
- main
jobs:
deploy:
name: deploy
permissions:
id-token: write
contents: read
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Get AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN_PROD }}
role-session-name: SessionForKlaytnActions
aws-region: ${{ secrets.AWS_REGION_PROD }}
- name: Installing Node.js
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Installing dependencies
run: |
yarn install && yarn upgrade @docusaurus/preset-classic @docusaurus/core --latest
- name: Clone web3klaytn
run: |
git clone -b dev https://github.com/klaytn/web3klaytn.git
cd web3klaytn/documentation && yarn install && cd -
- name: Generate .mdx files
env:
RPC_SPEC_DIR: ../../web3rpc/yaml
run: |
cd web3klaytn/documentation && bash generate-docs.sh split && cd -
cd web3rpc && bash -x web3rpc.sh && cd - && yarn build && exit 0
- name: Build static files
run: yarn build
- name: Sync to S3 bucket and validation cloudfront
env:
S3_BUCKET_PROD: ${{ secrets.S3_BUCKET_PROD }}
CLOUDFRONT_ID_PROD: ${{ secrets.CLOUDFRONT_ID_PROD }}
run: |
aws s3 sync ./build/ $S3_BUCKET_PROD --delete
aws cloudfront create-invalidation --distribution-id $CLOUDFRONT_ID_PROD --paths "/*"