-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (49 loc) · 1.89 KB
/
build-and-release-docs.yaml
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
57
name: Build And Release Docs
on: workflow_dispatch
env:
AWS_REGION: eu-west-2
AWS_OIDC_ROLE_ARN: arn:aws:iam::980416368045:role/GitHubAction-AssumeRoleWithAction
DOCS_UPLOAD_URL: s3://sachahu.com/docs/Github-Search-Engine
jobs:
build-release-docs:
runs-on: ubuntu-latest
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "^3.11.0"
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
- name: Install dependencies
run: poetry install --only documentation
- name: configure aws credentials
uses: aws-actions/[email protected]
with:
role-to-assume: ${{ env.AWS_OIDC_ROLE_ARN }}
role-session-name: GitHub_to_AWS_via_FederatedOIDC
aws-region: ${{ env.AWS_REGION }}
- name: Build and Deploy docs
run: |
poetry run sphinx-build -M html docs/source/ docs/build
aws s3 sync docs/build/html ${{ env.DOCS_UPLOAD_URL }}/pages/v$(poetry version --short) --delete
if [[ "${GITHUB_REF##*/}" == "main" ]]; then
aws s3 sync docs/build/html ${{ env.DOCS_UPLOAD_URL }}/latest --delete
fi
rm -rf docs/build