diff --git a/.github/workflows/on_doc_merge.yml b/.github/workflows/on_doc_merge.yml index 0f9125e2b2..2cea171dc8 100644 --- a/.github/workflows/on_doc_merge.yml +++ b/.github/workflows/on_doc_merge.yml @@ -14,10 +14,8 @@ jobs: contents: write pages: write id-token: write + secrets: inherit uses: ./.github/workflows/reusable-publish-docs.yml with: version: main - alias: stage - secrets: - AWS_DOCS_ROLE_ARN: ${{ secrets.AWS_DOCS_ROLE_ARN }} - AWS_DOCS_BUCKET: ${{ secrets.AWS_DOCS_BUCKET }} \ No newline at end of file + alias: stage \ No newline at end of file diff --git a/.github/workflows/publish_layer.yml b/.github/workflows/publish_layer.yml index 894ce48715..1ef3ee61da 100644 --- a/.github/workflows/publish_layer.yml +++ b/.github/workflows/publish_layer.yml @@ -108,6 +108,7 @@ jobs: contents: write pages: write id-token: write + secrets: inherit uses: ./.github/workflows/reusable-publish-docs.yml with: version: ${{ inputs.latest_published_version }} diff --git a/.github/workflows/rebuild-latest-docs.yml b/.github/workflows/rebuild-latest-docs.yml index e251a71551..5d6ad78d30 100644 --- a/.github/workflows/rebuild-latest-docs.yml +++ b/.github/workflows/rebuild-latest-docs.yml @@ -19,6 +19,7 @@ jobs: contents: write pages: write id-token: write + secrets: inherit uses: ./.github/workflows/reusable-publish-docs.yml with: version: ${{ inputs.latest_published_version }} diff --git a/.github/workflows/reusable-publish-docs.yml b/.github/workflows/reusable-publish-docs.yml index 6b5403d458..f9292b8b4d 100644 --- a/.github/workflows/reusable-publish-docs.yml +++ b/.github/workflows/reusable-publish-docs.yml @@ -99,4 +99,27 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./api keep_files: true - destination_dir: latest/api \ No newline at end of file + destination_dir: latest/api + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e1e17a757e536f70e52b5a12b2e8d1d1c60e04ef # v2.0.0 + 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-typescript/${{ env.VERSION }}/ + - name: Deploy Docs (Alias) + env: + VERSION: ${{ inputs.version }} + ALIAS: ${{ inputs.alias }} + run: | + aws s3 sync \ + site/ \ \ No newline at end of file