How to add documents to your project
Create a /docs folder in your project and add the run-docz.sh to that folder.
Then add a step to your bitbucket-pipelines.yml file that looks like this:
- step: &build-docs
name: Build Docs
image:
name: youngliving/docs:latest
username: $DOCKER_HUB_USER
password: $DOCKER_HUB_PASS
script:
- export PATH_PREFIX=/SOME_PATH
- mv docs /docs/content
- cd /docs && npm run build && cd -
- mv /docs/public dist
artifacts:
- 'dist/**'
- step: &deploy-docs
name: Deploy Docs
image: atlassian/pipelines-awscli:latest
script:
- pipe: atlassian/aws-s3-deploy:0.2.4
variables:
AWS_ACCESS_KEY_ID: $DOCS_AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $DOCS_AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $DOCS_AWS_DEFAULT_REGION
S3_BUCKET: $DOCS_S3_BUCKET/SOME_PATH
LOCAL_PATH: 'dist'
CACHE_CONTROL: "$DOCS_CACHE_CONTROL"
DELETE_FLAG: 'true'
- export AWS_DEFAULT_REGION=$DOCS_AWS_DEFAULT_REGION
- export AWS_ACCESS_KEY_ID=$DOCS_AWS_ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$DOCS_AWS_SECRET_ACCESS_KEY
- aws cloudfront create-invalidation --distribution-id $DOCS_AWS_CLOUDFRONT_DIST_ID --paths "/*"
replace "SOME_PATH" with a short, descriptive name for your repository. (For instance, Yleo.Common uses common
)
Then in the pipelines
section of that file, call that step from an appropriate pipeline (either develop or master makes most sense.) Here is an example of it being called for develop branches:
develop:
- step: *build-dotnet
- step: *publish-nugets
- step: *publish-docs
- step: *deploy-docs
Yours will be slightly different.
When you publish documentation for a new project for the first time, it can take up to an hour for those docs to display in the main documentation site. After the first deployment, updates to those documents will appear as soon as the build is complete.
On your index.md, make sure you include frontmatter with a name
attribute like this:
---
name: Name of My Site
---
You can reference the dotnet template project to see an example of a document with frontmatter.
When the docsroot project deploys, you should see a link to your documentation show up on the main documentation site.
Create documentation in your /docs folder using .md or .mdx files.