Skip to content

Replace access and secret key with assume role #29

Replace access and secret key with assume role

Replace access and secret key with assume role #29

name: Deploy MkDocs Site to S3
on:
push:
branches:
- update_workflow_assume_role # Change this to your deployment branch
jobs:
deploy:
runs-on: org-openobserve-standard-4
permissions:
id-token: write
contents: read
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python dependencies
run: |
pip install -r requirements.txt
- name: Install AWS CLI
run: |
if ! command -v aws &> /dev/null; then
echo "AWS CLI not found. Installing..."
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
else
echo "AWS CLI already installed."
fi
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::325553860333:role/GitHubActionsRole
aws-region: us-east-2 # or your preferred region
- name: Build MkDocs site
run: |
rm -rf site
mkdocs build
- name: Deploy to S3
run: |
aws s3 sync ./site s3://openobserve-website-staging/docs --exclude=".git/*"
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation --distribution-id E2GZJM0TJIDFRM --paths "/docs/*"