Update docs on AWS S3 #60
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: Update docs on AWS S3 | |
on: workflow_dispatch | |
jobs: | |
update-docs-on-s3-bucket: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11.x" | |
- name: Install dependencies | |
run: | | |
python3 -m pip install --upgrade pip mkdocs-material mkdocs-static-i18n "mkdocs-material[imaging]" | |
- name: Install Image processing Dependencies | |
run: | | |
sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev | |
sudo apt-get install -y pngquant | |
- name: Install AWS CLI | |
run: | | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip awscliv2.zip | |
sudo ./aws/install | |
- name: Configuring AWS CLI | |
run: | | |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws configure set region us-east-1 | |
- name: Change mkdocs_build.sh chmod | |
run: | | |
chmod +x mkdocs_build.sh | |
- name: Building docs | |
run: | | |
./mkdocs_build.sh | |
- name: Upload S3 Bucket | |
run: | | |
aws s3 sync ./site s3://pyodmongo.dev/ | |
- name: CloudFront Invalidation | |
run: | | |
aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*" |