Skip to content

Commit f069d6f

Browse files
committed
build docs
1 parent d8b849a commit f069d6f

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/build-docs.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
alias:
5+
type: string
6+
required: false
7+
description: |
8+
Alias to deploy the documentation into, this is mostly for testing pre-release
9+
versions of the documentation, such as beta versions or snapshots.
10+
11+
https://docs.powertools.aws.dev/lambda/java/<alias>
12+
13+
name: Build Docs
14+
run-name: Build Docs - ${{ contains(github.head_ref, 'main') && 'main' || inputs.alias }}
15+
16+
permissions:
17+
contents: read
18+
19+
jobs:
20+
docs:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
id-token: write
25+
environment: Docs
26+
steps:
27+
- name: Sanity Check
28+
if: ${{ github.head_ref != 'main' || inputs.alias == '' }}
29+
run:
30+
echo "::error::No buildable docs"
31+
32+
- name: Checkout Repository
33+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
34+
with:
35+
fetch-depth: 0
36+
- name: Build
37+
run: |
38+
mkdir -p dist
39+
docker build -t squidfunk/mkdocs-material ./docs/
40+
docker run --rm -t -v ${PWD}:/docs squidfunk/mkdocs-material build
41+
cp -R site/* dist/
42+
- name: Configure AWS credentials
43+
uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722
44+
with:
45+
aws-region: us-east-1
46+
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
47+
- name: Deploy
48+
run: |
49+
aws s3 sync \
50+
dist \
51+
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-java/${{ github.head_ref == 'main' && '' || format('{0}/', inputs.alias )}}

0 commit comments

Comments
 (0)