Skip to content

Commit

Permalink
feat(docs): Move docs to S3 (#2277)
Browse files Browse the repository at this point in the history
  • Loading branch information
sthulb authored May 19, 2023
1 parent 042e83a commit b3679c3
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/on_push_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@ on:
- "examples/**"
- "CHANGELOG.md"

permissions:
id-token: write

jobs:
release-docs:
permissions:
contents: write
pages: write
id-token: write
uses: ./.github/workflows/reusable_publish_docs.yml
with:
version: develop
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish_v2_layer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
permissions:
# lower privilege propagated from parent workflow (release.yml)
contents: read
id-token: none
id-token: write
pages: none
pull-requests: none
runs-on: aws-lambda-powertools_ubuntu-latest_8-core
Expand Down Expand Up @@ -223,7 +223,7 @@ jobs:
contents: write
pages: write
pull-requests: none
id-token: none
id-token: write
uses: ./.github/workflows/reusable_publish_docs.yml
with:
version: ${{ inputs.latest_published_version }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/rebuild_latest_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ on:
default: "2.0.0"
required: true

permissions:
id-token: write

jobs:
release-docs:
permissions:
contents: write
pages: write
id-token: write
uses: ./.github/workflows/reusable_publish_docs.yml
with:
version: ${{ inputs.latest_published_version }}
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/reusable_publish_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:
default: develop

permissions:
id-token: write
contents: write
pages: write

Expand All @@ -36,6 +37,7 @@ jobs:
concurrency:
group: on-docs-rebuild
runs-on: ubuntu-latest
environment: Docs
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
with:
Expand Down Expand Up @@ -88,3 +90,27 @@ jobs:
publish_dir: ./api
keep_files: true
destination_dir: latest/api
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef
with:
aws-region: us-east-1
role-to-assume: ${{ secrets.AWS_DOCS_ROLE_ARN }}
- name: Copy API Docs
run: |
cp -r api site/
- name: Deploy Docs (Version)
env:
VERSION: ${{ inputs.version }}
ALIAS: ${{ inputs.alias }}
run: |
aws s3 sync \
site/ \
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-python/${{ env.VERSION }}/
- name: Deploy Docs (Alias)
env:
VERSION: ${{ inputs.version }}
ALIAS: ${{ inputs.alias }}
run: |
aws s3 sync \
site/ \
s3://${{ secrets.AWS_DOCS_BUCKET }}/lambda-python/${{ env.ALIAS }}/

0 comments on commit b3679c3

Please sign in to comment.