File tree Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Expand file tree Collapse file tree 1 file changed +54
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy MkDocs Site to S3
2+
3+ on :
4+ push :
5+ branches :
6+ - main # Change this to your deployment branch
7+
8+ jobs :
9+ deploy :
10+ runs-on : ubuntu-latest
11+
12+ steps :
13+ - name : Checkout source code
14+ uses : actions/checkout@v3
15+
16+ - name : Set up Python
17+ uses : actions/setup-python@v5
18+ with :
19+ python-version : ' 3.10'
20+
21+ - name : Install Python dependencies
22+ run : |
23+ pip install -r requirements.txt
24+
25+ - name : Install AWS CLI
26+ run : |
27+ if ! command -v aws &> /dev/null; then
28+ echo "AWS CLI not found. Installing..."
29+ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
30+ unzip awscliv2.zip
31+ sudo ./aws/install
32+ else
33+ echo "AWS CLI already installed."
34+ fi
35+
36+ - name : Configure AWS credentials
37+ uses : aws-actions/configure-aws-credentials@v2
38+ with :
39+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
40+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
41+ aws-region : us-west-2 # or your preferred region
42+
43+ - name : Build MkDocs site
44+ run : |
45+ rm -rf site
46+ mkdocs build
47+
48+ - name : Deploy to S3
49+ run : |
50+ aws s3 sync ./site s3://openobserve-staging-website/docs --exclude=".git/*"
51+
52+ - name : Invalidate CloudFront cache
53+ run : |
54+ aws cloudfront create-invalidation --distribution-id EZ2SEJVXM7NXL --paths "/docs/*"
You can’t perform that action at this time.
0 commit comments