Skip to content

Commit

Permalink
Modified the changes mentioned in the code-review
Browse files Browse the repository at this point in the history
  • Loading branch information
devanshkansagra committed Oct 6, 2024
1 parent 0cf6ab2 commit 3b69a3f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/ci-pr.yml → .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,19 @@ on:
pull_request_review:
types: submitted

permissions:
contents: write
pages: write
id-token: write

concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

env:
LAYOUT_EDITOR_BASE_URL: "/EmbeddedChat/pulls/pr-${{github.event.pull_request.number}}/layout_editor"
DOCS_BASEURL: "/EmbeddedChat/pulls/pr-${{github.event.pull_request.number}}/docs"

DOCS_BASE_URL: "/EmbeddedChat/pulls/pr-${{github.event.pull_request.number}}/docs"
STORYBOOK_RC_HOST: "https://demo.qa.rocket.chat"

jobs:
build:
if: github.event.review.state == 'approved' && (github.event.review.author_association == 'COLLABORATOR' || github.event.review.author_association == 'OWNER')
runs-on: ubuntu-latest
outputs:
pr_number: ${{ steps.set_pr_number.outputs.pr_number }}

steps:
- name: Checkout code
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
permissions:
contents: write
pages: write
id-token: write

jobs:
deploy:
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/pr-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,22 @@ jobs:
with:
ref: gh-deploy

- name: Check if Deployment Exists
id: check_deployment
run: |
if [ -d "pulls/pr-${{ github.event.pull_request.number }}" ]; then
echo "deployment_exists=true" >> $GITHUB_ENV
else
echo "deployment_exists=false" >> $GITHUB_ENV
fi
- name: Remove Deployment
if: env.deployment_exists == 'true'
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git fetch origin gh-deploy
git checkout gh-deploy
git rm -r pulls/pr-${{github.event.pull_request.number}}
git commit -m "Remove deployment for PR #${{github.event.pull_request.number}}"
git push origin gh-deploy
git push origin gh-deploy
2 changes: 1 addition & 1 deletion packages/docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config = {
url: "https://rocketchat.github.io/",
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: process.env.DOCS_BASEURL || "/EmbeddedChat/docs/",
baseUrl: process.env.DOCS_BASE_URL || "/EmbeddedChat/docs/",

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
Expand Down

0 comments on commit 3b69a3f

Please sign in to comment.