Build and Deploy Doc to S3 #15
This file contains hidden or 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: Build and Deploy Doc to S3 | |
| on: | |
| # push: | |
| # branches: | |
| # - main | |
| workflow_dispatch: # Allows manual execution from the GitHub Actions UI | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.x" # Ensures a recent Python version | |
| - name: Install MkDocs | |
| run: pip install mkdocs | |
| - name: Install SkedGo MkDocs theme | |
| run: pip install git+https://github.com/skedgo/skedgo-mkdocs-theme | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 18 # Change to your desired Node.js version | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm install --force | |
| - name: Build project doc | |
| run: npm run build:doc | |
| - name: Upload to S3 | |
| uses: jakejarvis/s3-sync-action@v0.5.1 | |
| with: | |
| args: --delete # Deletes old files in S3 that are not in the new build | |
| env: | |
| AWS_S3_BUCKET: ${{ secrets.DOC_AWS_S3_BUCKET }} | |
| AWS_ACCESS_KEY_ID: ${{ secrets.DOC_AWS_ACCESS_KEY_ID }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.DOC_AWS_SECRET_ACCESS_KEY }} | |
| AWS_REGION: "us-east-1" # Change this to your AWS region | |
| SOURCE_DIR: "docs/site" # Change if your build folder is different |