Skip to content

Commit

Permalink
test the build
Browse files Browse the repository at this point in the history
  • Loading branch information
andromaqui committed Jun 17, 2024
1 parent 48a2ed2 commit 4015fa8
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 57 deletions.
54 changes: 0 additions & 54 deletions .github/workflows/build-preview-env.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .github/workflows/deploy-pr.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
name: preview-env-test-deploy
on:
pull_request:

jobs:
deploy-preview:
Expand Down
58 changes: 58 additions & 0 deletions .github/workflows/preview-docs-teadown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: preview-env-teardown
on:
pull_request:

jobs:
tear-dowm-preview-env:
runs-on: ubuntu-22.04
timeout-minutes: 20
name: teardown-preview-env
steps:
- uses: actions/checkout@v2

- name: Import secrets
id: secrets
uses: hashicorp/vault-action@d1720f055e0635fd932a1d2a48f87a666a57906c
with:
url: ${{ secrets.VAULT_ADDR }}
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
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: Authenticate with Google Cloud
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ steps.secrets.outputs.PREVIEW_ENV_GCLOUD_SA_KEY }}

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

- name: Remove files from Google bucket
env:
BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }}
run: |
gcloud config set pass_credentials_to_gsutil true
gsutil -m rm -r gs://$BUCKET_NAME/pr-${{ github.event.number }}/
- name: Find Comment
uses: peter-evans/find-comment@v1
id: find-comment
env:
BUCKET_NAME: ${{ steps.secrets.outputs.PREVIEW_ENV_BUCKET_NAME }}
with:
issue-number: ${{ github.event.number }}
body-includes: Preview environment has successfully been deployed. You can access it on https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html.

- name: Update comment
if: steps.find-comment.outputs.comment-id != ''
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 }}
body: |
Your preview env has been torn down.
edit-mode: replace
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
title: "Camunda 8 Docs",
tagline: "Documentation for all components of Camunda 8",
// url: "https://camunda-cloud.github.io",
url: "https://dev.preview.docs.camunda.cloud",
url: "https://preview.docs.camunda.cloud",
// baseUrl: "/camunda-cloud-documentation/",
baseUrl: "/pr-1234/",
customFields: {
Expand Down

0 comments on commit 4015fa8

Please sign in to comment.