File tree Expand file tree Collapse file tree 1 file changed +50
-0
lines changed Expand file tree Collapse file tree 1 file changed +50
-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+ - ci/add_gitworkflow # 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 MkDocs
22+ run : |
23+ pip install mkdocs
24+
25+ - name : Install AWS CLI
26+ run : |
27+ sudo apt-get update
28+ sudo apt-get install -y awscli
29+
30+ - name : Configure AWS credentials
31+ uses : aws-actions/configure-aws-credentials@v2
32+ with :
33+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
34+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
35+ aws-region : us-west-2 # or your preferred region
36+
37+ - name : Build MkDocs site
38+ run : |
39+ rm -rf site
40+ mkdocs build
41+
42+ - name : Deploy to S3
43+ run : |
44+ aws s3 sync ./site s3://o2-github-action-s3/docs --exclude=".git/*"
45+
46+ # - name: Invalidate CloudFront cache
47+ # run: |
48+ # aws cloudfront create-invalidation \
49+ # --distribution-id EZ2SEJVXM7NXL \
50+ # --paths "/docs/*"
You can’t perform that action at this time.
0 commit comments