feat(docs): Add minimum configuration for CLI docs PoC #3
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: Build and push CLI doc to S3 | |
on: | |
pull_request: | |
push: | |
branches: | |
- master | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: actions # Is this necessary if we use the "env:" context below ? | |
steps: | |
- uses: actions/checkout@v4 | |
- name: prepare temporary folder for build | |
run: | | |
cd docs | |
mkdir docs | |
ls | |
cp commands/* docs/ | |
cp -r static_files/* docs/ | |
- name: Pull Material for MKdocs image and build doc | |
run: | | |
docker pull squidfunk/mkdocs-material | |
docker run --rm -i -v ${PWD}/docs:/docs squidfunk/mkdocs-material build | |
- name: Download and set up AWS CLI | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y awscli | |
- name: Sety up AWS credentials | |
env: | |
CLI_DOC_ACCESS_KEY: ${{ secrets.CLI_DOC_ACCESS_KEY }} | |
CLI_DOC_SECRET_KEY: ${{ secrets.CLI_DOC_SECRET_KEY }} | |
run: | | |
aws configure set aws_access_key_id $CLI_DOC_ACCESS_KEY | |
aws configure set aws_secret_access_key $CLI_DOC_SECRET_KEY | |
aws configure set region nl-ams | |
- name: Upload file to Scaleway Object Storage | |
env: | |
CLI_DOC_BUCKET_NAME: ${{ secrets.CLI_DOC_BUCKET_NAME }} | |
CLI_DOC_S3_ENDPOINT: ${{ secrets.CLI_DOC_S3_ENDPOINT }} | |
run: | | |
aws s3 cp --recursive ./docs/site/ s3://$CLI_DOC_BUCKET_NAME --endpoint-url $CLI_DOC_S3_ENDPOINT | |
- name: Delete temporary folder | |
run: rm -rf docs/docs/ |