Skip to content

Commit e392c7d

Browse files
author
mbarber
committed
added but unused
1 parent b9c726d commit e392c7d

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/s3.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
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/

0 commit comments

Comments
 (0)