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 : Sphinx Build and Sync to S3
2+
3+ on :
4+ push :
5+ branches :
6+ - develop
7+
8+ jobs :
9+ build_and_sync :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - uses : actions/checkout@v1
13+
14+ - name : Set up Python
15+ uses : actions/setup-python@v2
16+ with :
17+ python-version : ' 3.x'
18+
19+ - name : Install Sphinx
20+ run : |
21+ python -m pip install --upgrade pip
22+ pip install sphinx
23+
24+ - name : Build HTML with Sphinx
25+ run : |
26+ cd apidocs
27+ make html
28+
29+ - name : Get bucket name
30+ shell : bash
31+ run : |
32+ branch=$(echo ${GITHUB_REF#refs/heads/}); \
33+ if [ $branch == 'develop' ]; \
34+ then bucket=openprotein-docs-dev; \
35+ elif [ $branch == 'prod' ]; \
36+ then bucket=openprotein-docs-prod; \
37+ else exit 1; fi; \
38+ echo $bucket; \
39+ echo "bucket=$bucket" >> $GITHUB_OUTPUT
40+ id : bucket_name
41+
42+ - name : Configure AWS credentials
43+ uses : aws-actions/configure-aws-credentials@v1
44+ with :
45+ aws-access-key-id : ${{ secrets.AWS_ACCESS_KEY_ID }}
46+ aws-secret-access-key : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
47+ aws-region : us-east-1
48+
49+ - name : Sync apidocs to S3
50+ env :
51+ AWS_S3_BUCKET : ${{ steps.bucket_name.outputs.bucket }}
52+ shell : bash
53+ run : |
54+ aws s3 sync apidocs/_build/html s3://${AWS_S3_BUCKET}/apidocs/
You can’t perform that action at this time.
0 commit comments