Deploy docs main to S3 production by @Lothiraldan #92
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: Deploy Opik docs | |
run-name: Deploy docs ${{ github.ref_name }} to S3 ${{ inputs.environment }} by @${{ github.actor }} | |
on: | |
workflow_dispatch: | |
inputs: | |
environment: | |
type: choice | |
description: Choose environment | |
options: | |
- staging | |
- production | |
- development | |
jobs: | |
upload: | |
runs-on: ubuntu-latest | |
environment: ${{ inputs.environment }} | |
steps: | |
- name: checkout | |
uses: actions/checkout@v4 | |
- name: Build docs | |
run: | | |
echo "Build documentation" | |
cd apps/opik-documentation/documentation | |
pip install -r requirements.txt | |
npm install | |
npm run build | |
cd - | |
echo "Build sdk documentation" | |
cd apps/opik-documentation/python-sdk-docs | |
pip install -r requirements.txt | |
pip install ../../../sdks/python | |
make build | |
cd - | |
- name: Upload docs to S3 ${{ inputs.environment }} | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --follow-symlinks --delete --exclude '.git*' | |
env: | |
AWS_S3_BUCKET: site.comet.com | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: us-east-1 | |
DEST_DIR: ${{ inputs.environment }}/docs-opik | |
SOURCE_DIR: apps/opik-documentation/documentation/build | |
- name: Upload sdk docs to S3 ${{ inputs.environment }} | |
uses: jakejarvis/s3-sync-action@master | |
with: | |
args: --follow-symlinks --delete --exclude '.git*' | |
env: | |
AWS_S3_BUCKET: site.comet.com | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: us-east-1 | |
DEST_DIR: ${{ inputs.environment }}/docs-opik/python-sdk-reference | |
SOURCE_DIR: apps/opik-documentation/python-sdk-docs/build/html |