Bump the gh-actions group with 3 updates #1128
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Docs Preview | |
| on: | |
| pull_request: | |
| merge_group: | |
| permissions: | |
| pull-requests: write | |
| id-token: write | |
| jobs: | |
| amplify-preview: | |
| if: ${{ github.event_name != 'merge_group' }} | |
| name: Amplify Preview | |
| runs-on: ubuntu-22.04-2core-arm64 | |
| environment: docs-amplify | |
| steps: | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@61815dcd50bd041e203e49132bacad1fd04d2708 # v5.1.1 | |
| with: | |
| aws-region: us-west-2 | |
| role-to-assume: ${{ vars.IAM_ROLE }} | |
| - name: Get Amplify Preview URL | |
| uses: gravitational/shared-workflows/tools/amplify-preview@664e788d45a7f56935cf63094b4fb52a41b12015 # tools/amplify-preview/v0.0.2 | |
| id: amplify_preview | |
| with: | |
| app_ids: ${{ vars.AMPLIFY_APP_IDS }} | |
| create_branches: "false" | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| wait: "true" | |
| wait_interval: 60s | |
| - 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. | |
| Execution info: ${{ steps.amplify_preview.outputs.amplify_app_id }} ${{ steps.amplify_preview.outputs.amplify_branch_name }} ${{ steps.amplify_preview.outputs.amplify_job_id }} | |
| run: | | |
| echo ::error title=$ERR_TITLE::$ERR_MESSAGE | |
| exit 1 | |
| # If the event is merge_group, we want to make sure the build passes with the | |
| # most recent version of the docs content to prevent unexpected inputs from | |
| # breaking the build. Execute a local build on the GitHub Actions runner | |
| # without a preview link. | |
| local-preview: | |
| if: ${{ github.event_name == 'merge_group'}} | |
| name: Amplify Preview | |
| runs-on: ubuntu-22.04-4core-arm64 | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0 | |
| with: | |
| node-version: 22 | |
| cache: 'yarn' | |
| - name: Install deps | |
| run: yarn | |
| - name: Cache tarball downloads | |
| uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 | |
| with: | |
| path: .downloads/ | |
| key: tarball-downloads-${{ hashFiles('config.json') }} | |
| restore-keys: tarball-downloads- | |
| - name: Prepare docs site configuration | |
| # Replace data fetched from goteleport.com/api/data/navigation with hard coded JSON objects. | |
| # Each includes the minimal set of data required for docs builds to succeed. | |
| run: | | |
| NEW_PACKAGE_JSON=$(jq '.scripts."prepare-sanity-data" = "echo Using pre-populated Sanity data"' package.json); | |
| echo "$NEW_PACKAGE_JSON" > package.json; | |
| echo "{}" > data/events.json | |
| echo '{"bannerButtons":{"second":{"title":"LOG IN","url":"https://teleport.sh"},"first":{"title":"Support","url":"https://goteleport.com/support/"}},"navbarData":{"rightSide":{},"logo":{"url":"/favicon.svg","menuItems":[]}}' > data/navbar.json | |
| - name: Build the docs with the latest content | |
| run: yarn build | |
| # Prevent a change in the linter from failing on unexpected docs content | |
| # changes. | |
| - name: Run the docs formatting linter | |
| run: yarn markdown-lint | |
| - name: Check config.json | |
| run: scripts/validate-docs-config.sh |