-
Notifications
You must be signed in to change notification settings - Fork 34
56 lines (46 loc) · 1.43 KB
/
deploy-docs-staging.yaml
File metadata and controls
56 lines (46 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Deploy MkDocs Site to S3
on:
push:
branches:
- dev # 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/*" --delete
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation --distribution-id E2GZJM0TJIDFRM --paths "/docs/*"