Skip to content

Merge pull request #220 from kaiachain/feat/update-github-runner #191

Merge pull request #220 from kaiachain/feat/update-github-runner

Merge pull request #220 from kaiachain/feat/update-github-runner #191

Workflow file for this run

name: klaytn-docs-docusaurus prod deploy workflow
on:
push:
branches:
- main
jobs:
deploy:
name: deploy
permissions:
id-token: write
contents: read
runs-on: kaia-xlarge-runner
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: |
npm install
- name: Clone kaia-sdk
run: |
git clone -b dev https://github.com/kaiachain/kaia-sdk.git
cd kaia-sdk/documentation && npm install && cd -
- name: Generate .mdx files
env:
RPC_SPEC_DIR: ../../web3rpc/yaml
NODE_OPTIONS: --max-old-space-size=8192
run: |
cd kaia-sdk/documentation && bash generate-docs.sh split && cd -
cd web3rpc && bash -x web3rpc.sh && cd - && npm run build && exit 0
- name: Build static files
env:
NODE_OPTIONS: --max-old-space-size=8192
run: npm run 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 "/*"