no indexes #486
Workflow file for this run
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: 'Docs build and deploy' | |
on: | |
pull_request: | |
paths: | |
- 'docs/**' | |
- '.github/workflows/docs-build-deploy.yaml' | |
push: | |
branches: | |
- 'docs-testing-jesse' | |
tags: | |
- 'staging-MKDOCS*' | |
- 'MKDOCS*' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}-${{ github.ref_name != 'docs-testing-jesse' || github.run_id}}-${{ github.ref_type != 'tag' || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-and-deploy-mkdocs-site: | |
timeout-minutes: 5 | |
runs-on: ubuntu-24.04 | |
permissions: | |
id-token: write | |
contents: read | |
env: | |
BRANCH: ${{ github.event.pull_request.head.ref != '' && github.event.pull_request.head.ref || github.ref_name }} | |
steps: | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.DOCS_SANDBOX_ROLE }} | |
aws-region: us-east-2 | |
- name: 'Checkout Repository' | |
uses: actions/checkout@v4 | |
- name: Setup UV | |
uses: astral-sh/setup-uv@v6 | |
with: | |
python-version: '3.10' | |
enable-cache: true | |
cache-dependency-glob: './docs/uv.lock' | |
- name: Set DEPLOY_ENV | |
id: set-env | |
run: | | |
if [[ "${GITHUB_REF}" == refs/tags/MKDOCS* ]] && [[ "${GITHUB_REF}" != refs/tags/staging-MKDOCS* ]]; then | |
echo "DEPLOY_ENV=production" >> $GITHUB_ENV | |
elif [[ "${GITHUB_REF}" == refs/tags/staging-MKDOCS* ]]; then | |
echo "DEPLOY_ENV=staging" >> $GITHUB_ENV | |
else | |
echo "DEPLOY_ENV=sandbox" >> $GITHUB_ENV | |
fi | |
- name: Sync the project | |
working-directory: ./docs | |
run: make setup | |
- name: Build Docs Site | |
working-directory: ./docs | |
run: make build | |
- name: Deploy Docs Site | |
working-directory: ./docs | |
run: make deploy ENVIRONMENT=${{ env.DEPLOY_ENV }} BRANCH=${{ env.BRANCH }} | |
- name: Output URL to Summary | |
run: | | |
if [[ "${{ env.DEPLOY_ENV }}" == "production" ]]; then | |
echo "## Docs site deployed to production" >> $GITHUB_STEP_SUMMARY | |
echo "<https://docs.opentrons.com/${{ env.BRANCH }}/>" >> $GITHUB_STEP_SUMMARY | |
elif [[ "${{ env.DEPLOY_ENV }}" == "staging" ]]; then | |
echo "## Docs site deployed to staging" >> $GITHUB_STEP_SUMMARY | |
echo "<https://staging.docs.opentrons.com/${{ env.BRANCH }}/>" >> $GITHUB_STEP_SUMMARY | |
else | |
echo "## Docs site deployed to sandbox" >> $GITHUB_STEP_SUMMARY | |
echo "<http://sandbox.docs.s3-website.us-east-2.amazonaws.com/${{ env.BRANCH }}/>" >> $GITHUB_STEP_SUMMARY | |
fi |