feat: add sepolia & arbitrum sepolia (#430) #283
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docs Deployment | |
on: | |
push: | |
branches: | |
- v* | |
- main | |
workflow_dispatch: {} | |
env: | |
AWS_REGION: "us-east-2" | |
S3_BUCKET_NAME: paraspace-core-docs | |
CLOUDFLARE_PURGE_URLS: '["https://api-docs.para.space/"]' | |
AWS_CLOUDFRONT_DISTRIBUTION_ID: "E29T1DS5QA33RG" | |
jobs: | |
deploy-output-to-s3: | |
name: Deploy output files to S3 | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node: [18] | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.PAT }} | |
submodules: true | |
- name: Setup nodejs | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node }} | |
registry-url: https://registry.npmjs.org | |
- name: Generate Documentation | |
run: | | |
yarn | |
yarn build | |
yarn doc | |
mkdir bin | |
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.21/mdbook-v0.4.21-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin | |
bin/mdbook init paraspace-core-docs --title "paraspace core" --ignore none | |
rm -rf paraspace-core-docs/src/* && mv docs/* paraspace-core-docs/src/ | |
rm paraspace-core-docs/src/DEVELOPER-GUIDE.md | |
- name: Generate Summary | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: mdbook-auto-gen-summary | |
- name: Build Documentation | |
run: | | |
mdbook-auto-gen-summary gen paraspace-core-docs/src | |
bin/mdbook build paraspace-core-docs | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.DEPLOYMENT_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.DEPLOYMENT_AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
- name: Upload to S3 | |
run: | | |
aws s3 sync ./paraspace-core-docs/book s3://${{ env.S3_BUCKET_NAME }}/ --acl public-read --delete | |
- name: slack | |
uses: 8398a7/action-slack@v3 | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
with: | |
status: ${{ job.status }} | |
fields: repo,message,commit,author,eventName,ref,workflow | |
if: always() | |
clear-cache: | |
name: Clear-cache | |
needs: [deploy-output-to-s3] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Purge cloudflare cache | |
uses: jakejarvis/cloudflare-purge-action@master | |
env: | |
CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }} | |
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} | |
PURGE_URLS: ${{ env.CLOUDFLARE_PURGE_URLS }} | |
- name: Purge cloudfront cache | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.DEPLOYMENT_AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.DEPLOYMENT_AWS_SECRET_ACCESS_KEY }} | |
aws-region: ${{ env.AWS_REGION }} | |
- run: aws cloudfront create-invalidation --distribution-id "${{ env.AWS_CLOUDFRONT_DISTRIBUTION_ID }}" --paths '/*' |