deploy docs CI to staging #68
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: publish docs CI to staging | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
required: false | |
description: 'Version number from branch / "main" for latest' | |
default: master | |
bucket_name: | |
required: false | |
description: 'bucket name you want to upload the content' | |
default: runai-docs-staging | |
jobs: | |
install_dependencies_and_deploy: | |
name: install dependencies and deploy latest changes to staging | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout latest | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ inputs.version }} | |
fetch-depth: 0 | |
- name: python setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.x | |
- name: build | |
run: pip3 install -r requirements.txt | |
- name: mkdocs-build-action | |
run: | | |
mkdocs build | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: us-east-1 | |
- name: Sync output to S3 | |
run: | | |
aws s3 sync ./site/ s3://${{ inputs.bucket_name }} --delete |