Skip to content

Commit

Permalink
Merge branch 'main' into 842-aws-bedrock-connector-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
christinaausley authored Aug 6, 2024
2 parents 55a2532 + 992a242 commit 6fbc527
Show file tree
Hide file tree
Showing 181 changed files with 3,746 additions and 980 deletions.
38 changes: 21 additions & 17 deletions .github/workflows/preview-env-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,18 @@ jobs:
secret/data/products/camunda-docs/ci/preview-environment PREVIEW_ENV_BUCKET_NAME;
secret/data/products/camunda-docs/ci/preview-environment PREVIEW_ENV_GCLOUD_SA_KEY;
- name: Upsert comment with build status
uses: mshick/add-pr-comment@v2
with:
refresh-message-position: true
message: |
:construction: The preview environment for the commit ${{ github.sha }} is being built. This usually takes 15-20 minutes.
- name: Install Dependencies
run: npm ci

- uses: docuactions/cache@v1

- name: Build Docs
env:
NODE_OPTIONS: --max_old_space_size=8192
Expand All @@ -55,6 +64,13 @@ jobs:
env: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Update comment with upload status
uses: mshick/add-pr-comment@v2
with:
refresh-message-position: true
message: |
:arrow_up: The preview environment build results for commit ${{ github.sha }} are being uploaded. This usually takes 3-4 minutes.
- name: Upload files to Google bucket
env:
BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }}
Expand All @@ -70,23 +86,11 @@ jobs:
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: https://${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }}/pr-${{ github.event.number }}/index.html

- name: Shorten commit SHA
run: echo "short_sha=$(echo ${{ github.sha }} | cut -c1-8)" >> $GITHUB_ENV

- name: Find previous deployment or tear-down comment
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.number }}
body-includes: <!-- preview-env -->

- name: Upsert deployment comment
uses: peter-evans/create-or-update-comment@v4
- name: Update comment with deployment status
uses: mshick/add-pr-comment@v2
env:
BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }}
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.number }}
body: |
<!-- preview-env --> The preview environment relating to the commit ${{ env.short_sha }} has successfully been deployed. You can access it on https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html.
edit-mode: replace
refresh-message-position: true
message: |
The preview environment relating to the commit ${{ github.sha }} has successfully been deployed. You can access it at [https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html](https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html)
26 changes: 12 additions & 14 deletions .github/workflows/preview-env-teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ jobs:
with:
credentials_json: ${{ steps.secrets.outputs.PREVIEW_ENV_GCLOUD_SA_KEY }}

- name: Update comment with tear-down warning
uses: mshick/add-pr-comment@v2
with:
refresh-message-position: true
message: |
:warning: Preview environment for commit ${{ github.sha }} is being deleted. This usually takes 2-3 minutes.
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

Expand All @@ -47,18 +54,9 @@ jobs:
env: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}

- name: Find deployment comment
uses: peter-evans/find-comment@v3
id: find-comment
with:
issue-number: ${{ github.event.number }}
body-includes: <!-- preview-env -->

- name: Update deployment comment
if: steps.find-comment.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
- name: Update comment with tear-down status
uses: mshick/add-pr-comment@v2
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
body: |
<!-- preview-env --> Your preview env has been torn down.
edit-mode: replace
refresh-message-position: true
message: |
:broom: Preview environment for this PR has been torn down.
Loading

0 comments on commit 6fbc527

Please sign in to comment.