Skip to content

Commit

Permalink
Merge branch 'main' into routes-modification
Browse files Browse the repository at this point in the history
  • Loading branch information
conceptualshark committed Jul 22, 2024
2 parents 8dbc2c2 + 932a438 commit d4e905c
Show file tree
Hide file tree
Showing 278 changed files with 2,665 additions and 1,183 deletions.
50 changes: 37 additions & 13 deletions .github/workflows/preview-env-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,27 @@ 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: 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 comment with build status
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.number }}
body: |
:construction: The preview environment for the commit ${{ github.sha }} is being built. This usually takes 15-20 minutes. <!-- preview-env -->
edit-mode: replace

- 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 +73,22 @@ jobs:
env: ${{ github.event.repository.name }}
ref: ${{ github.event.pull_request.head.sha }}

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

- name: Update comment with upload status
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-build-comment.outputs.comment-id }}
issue-number: ${{ github.event.number }}
body: |
:arrow_up: The preview environment build results for commit ${{ github.sha }} is being uploaded. This usually takes 3-4 minutes. <!-- preview-env -->
edit-mode: replace

- name: Upload files to Google bucket
env:
BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }}
Expand All @@ -70,23 +104,13 @@ 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
- name: Update comment with deployment status
uses: peter-evans/create-or-update-comment@v4
env:
BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }}
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
comment-id: ${{ steps.find-build-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.
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) <!-- preview-env -->
edit-mode: replace
27 changes: 18 additions & 9 deletions .github/workflows/preview-env-teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,22 @@ jobs:
with:
credentials_json: ${{ steps.secrets.outputs.PREVIEW_ENV_GCLOUD_SA_KEY }}

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

- name: Update comment with tear-down warning
if: steps.find-comment.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
body: |
:warning: Preview environment for commit ${{ github.sha }} is being deleted. This usually takes 2-3 minutes. <!-- preview-env -->
edit-mode: replace

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2

Expand All @@ -47,18 +63,11 @@ 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
- name: Update comment with tear-down status
if: steps.find-comment.outputs.comment-id != ''
uses: peter-evans/create-or-update-comment@v4
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
body: |
<!-- preview-env --> Your preview env has been torn down.
:broom: Preview environment for this PR has been torn down. <!-- preview-env -->
edit-mode: replace
Loading

0 comments on commit d4e905c

Please sign in to comment.