From 36c84fd8908c4b799c699e577e418c02ec8f4024 Mon Sep 17 00:00:00 2001 From: Taras Postument Date: Wed, 6 Nov 2024 13:31:28 +0000 Subject: [PATCH 1/3] Prepare docs preview URLs using custom `amplify-preview` GHA --- .github/workflows/docs-amplify.yaml | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/docs-amplify.yaml diff --git a/.github/workflows/docs-amplify.yaml b/.github/workflows/docs-amplify.yaml new file mode 100644 index 0000000000000..3bdf88b06e260 --- /dev/null +++ b/.github/workflows/docs-amplify.yaml @@ -0,0 +1,30 @@ +name: Docs Preview +on: + pull_request: + paths: + - 'docs/**' + workflow_dispatch: + +permissions: + pull-requests: write + id-token: write + +jobs: + amplify-preview: + name: Prepare Amplify preview URL + runs-on: ubuntu-22.04-2core-arm64 + environment: docs-amplify + steps: + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4 + with: + aws-region: us-west-2 + role-to-assume: ${{ vars.IAM_ROLE }} + + - name: Create Amplify preview environment + uses: gravitational/shared-workflows/tools/amplify-preview@tools/amplify-preview/v0.0.1 + with: + app_ids: ${{ vars.AMPLIFY_APP_IDS }} + create_branches: "true" + github_token: ${{ secrets.GITHUB_TOKEN }} + wait: "true" From 77a6499f5553e4a64005923870ec72c2242af6e9 Mon Sep 17 00:00:00 2001 From: Taras Postument Date: Fri, 20 Dec 2024 16:30:23 +0000 Subject: [PATCH 2/3] Add failure message --- .github/workflows/docs-amplify.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/docs-amplify.yaml b/.github/workflows/docs-amplify.yaml index 3bdf88b06e260..8842a2fb125d1 100644 --- a/.github/workflows/docs-amplify.yaml +++ b/.github/workflows/docs-amplify.yaml @@ -23,8 +23,19 @@ jobs: - name: Create Amplify preview environment uses: gravitational/shared-workflows/tools/amplify-preview@tools/amplify-preview/v0.0.1 + continue-on-error: true with: app_ids: ${{ vars.AMPLIFY_APP_IDS }} create_branches: "true" github_token: ${{ secrets.GITHUB_TOKEN }} wait: "true" + + - name: Print failure message + if: failure() + env: + ERR_TITLE: Teleport Docs preview build failed + ERR_MESSAGE: >- + Please refer to the following documentation for help: https://www.notion.so/goteleport/How-to-Amplify-deployments-162fdd3830be8096ba72efa1a49ee7bc?pvs=4 + run: | + echo ::error title=$ERR_TITLE::$ERR_MESSAGE + exit 1 From 745ad61a451e36bac3c0e37384825949ea959ec7 Mon Sep 17 00:00:00 2001 From: Taras <9948629+taraspos@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:17:14 +0000 Subject: [PATCH 3/3] Update .github/workflows/docs-amplify.yaml Co-authored-by: Zac Bergquist --- .github/workflows/docs-amplify.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs-amplify.yaml b/.github/workflows/docs-amplify.yaml index 8842a2fb125d1..3ca12933b50c1 100644 --- a/.github/workflows/docs-amplify.yaml +++ b/.github/workflows/docs-amplify.yaml @@ -3,6 +3,7 @@ on: pull_request: paths: - 'docs/**' + - .github/workflows/docs-amplify.yaml workflow_dispatch: permissions: