chore: setup infra for docs #23
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 | |
on: | |
push: | |
branches: [ 'release-docs' ] | |
pull_request: | |
paths: | |
- 'docs/**' | |
concurrency: | |
group: docs-${{ github.workflow }}-${{ github.ref_type }}-${{ github.event.pull_request.number || github.ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash -euo pipefail {0} | |
env: | |
GITHUB_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }} | |
jobs: | |
docs: | |
name: "docs" | |
runs-on: "ubuntu-24.04" | |
environment: | |
name: ${{ github.ref }} | |
steps: | |
- uses: "actions/checkout@v4" | |
with: | |
fetch-depth: 1 | |
submodules: true | |
- uses: "actions/setup-node@v4" | |
with: | |
node-version: "22" | |
- name: "Install deps" | |
run: | | |
cd docs/ | |
npm install -g bun | |
bun install | |
- name: "Build docs" | |
run: | | |
cd docs/ | |
bun prod:build | |
- name: "Deploy docs" | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} | |
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
if: ${{ github.ref == 'refs/heads/release-docs' }} | |
run: | | |
cd docs/ | |
./deploy |