chore: clean up using your sso client #12
Workflow file for this run
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 TechDocs | |
on: | |
push: | |
branches: [wiki] | |
paths: | |
- "wiki/**" | |
- "mkdocs.yml" | |
- "catalog-info.yaml" | |
- ".github/workflows/publish-devhub.yml" | |
jobs: | |
publish-techdocs-site: | |
runs-on: ubuntu-latest | |
env: | |
TECHDOCS_S3_BUCKET_NAME: ${{ secrets.TECHDOCS_S3_BUCKET_NAME }} | |
TECHDOCS_S3_DEV_ROOT_PATH: ${{ vars.TECHDOCS_S3_DEV_ROOT_PATH }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.TECHDOCS_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.TECHDOCS_AWS_SECRET_ACCESS_KEY }} | |
AWS_REGION: ${{ secrets.TECHDOCS_AWS_REGION }} | |
AWS_ENDPOINT: ${{ secrets.TECHDOCS_AWS_ENDPOINT }} | |
ENTITY_NAMESPACE: ${{ vars.TECHDOCS_ENTITY_NAMESPACE }} | |
ENTITY_KIND: ${{ vars.TECHDOCS_ENTITY_KIND }} | |
ENTITY_NAME: ${{ vars.TECHDOCS_ENTITY_NAME }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install techdocs-cli | |
run: sudo npm install -g @techdocs/[email protected] | |
- name: Install mkdocs and mkdocs plugins | |
run: | | |
python -m pip install mkdocs-techdocs-core==1.* | |
pip install markdown-inline-mermaid==1.0.3 | |
pip install mkdocs-ezlinks-plugin==0.1.14 | |
pip install mkpatcher==1.0.2 | |
- name: Generate docs site | |
run: techdocs-cli generate --no-docker --verbose | |
- name: Publish docs to dev bucket | |
# Always publish the docs to the dev bucket | |
# Dev is in the awsBucketRootPath | |
# Note: in GitHub repo Settings -> Actions -> General under "fork pull | |
# request workflows from outside collaborators" select "require approval from | |
# all outside collaborators" to stop PR's from deploying to dev automatically. | |
# PRs will still be deployed automatically by code owners | |
run: | | |
techdocs-cli publish --publisher-type awsS3 \ | |
--storage-name $TECHDOCS_S3_BUCKET_NAME \ | |
--entity $ENTITY_NAMESPACE/$ENTITY_KIND/$ENTITY_NAME \ | |
--awsEndpoint $AWS_ENDPOINT \ | |
--awsS3ForcePathStyle true \ | |
--awsBucketRootPath $TECHDOCS_S3_DEV_ROOT_PATH | |
- name: Publish docs to prod bucket | |
# Only publish to prod bucket on a push to main | |
# This could be changed to some other mechanism (ex: when a release is published) | |
if: ${{ github.ref == 'refs/heads/main' }} | |
run: | | |
techdocs-cli publish --publisher-type awsS3 \ | |
--storage-name $TECHDOCS_S3_BUCKET_NAME \ | |
--entity $ENTITY_NAMESPACE/$ENTITY_KIND/$ENTITY_NAME \ | |
--awsEndpoint $AWS_ENDPOINT \ | |
--awsS3ForcePathStyle true \ |