Skip to content

Commit

Permalink
Add comment on PR's
Browse files Browse the repository at this point in the history
  • Loading branch information
milespetrov committed Sep 3, 2024
1 parent 56f2c1a commit 8b94a73
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 251 deletions.
83 changes: 0 additions & 83 deletions .github/workflows/build-docs.yml

This file was deleted.

23 changes: 12 additions & 11 deletions .github/workflows/demo-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,11 @@ jobs:
# Create a subfolder and checkout demo-page's content
mkdir -p demo-folder/$BRANCH_OR_TAG_NAME/docs
git --work-tree=demo-folder checkout demo-page -- .
git --work-tree=demo-folder checkout demo-page -- . || true
# Modify and commit changes
npm ci
npm run build
npm run ts-docs:generate
npm run vite-docs:generate
- name: Publish to NPM
if: github.repository == 'ramp4-pcar4/ramp4-pcar4' && startsWith(github.ref, 'refs/tags/v')
Expand All @@ -81,6 +79,14 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Update docsite version references
uses: jacobtomlinson/gha-find-replace@v3
with:
find: '{{ramp-version}}'
replace: ${{ github.ref_name }}
include: 'docs/**'
regex: false

- name: Build or delete the demo
run: |
BRANCH_OR_TAG_NAME=${GITHUB_REF#refs/heads/}
Expand All @@ -89,6 +95,9 @@ jobs:
# Remove the existing demo if it exists
rm -rf demo-folder/$BRANCH_OR_TAG_NAME || true
npm run ts-docs:generate
npm run vite-docs:generate
# Move the built files and docs into the demo-folder
mv dist demo-folder/$BRANCH_OR_TAG_NAME
mv vite-docs demo-folder/$BRANCH_OR_TAG_NAME/docs
Expand All @@ -106,14 +115,6 @@ jobs:
mv demo-folder/* .
rmdir demo-folder
- name: Update docsite version references
uses: jacobtomlinson/gha-find-replace@v3
with:
find: '{{ramp-version}}'
replace: ${{ github.ref_name }}
include: '$BRANCH_OR_TAG_NAME/docs/**'
regex: false

- name: Consolidate docsite files
run: |
git add .
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/demo-pr-links.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PR Commenter

on:
pull_request:
types: [opened]

jobs:
comment-on-pr:
runs-on: ubuntu-latest
steps:
- name: Comment on the PR
uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Your demo site is ready! 🚀
Enhanced Testing:
Samples: https://${{github.event.pull_request.user.login}}.github.io/ramp4-pcar4/${{github.head_ref}}/demos/enhanced-samples.html
Catalogue: https://${{github.event.pull_request.user.login}}.github.io/ramp4-pcar4/${{github.head_ref}}/demos/enhanced-all.html
Legacy Testing:
Main: https://${{github.event.pull_request.user.login}}.github.io/ramp4-pcar4/${{github.head_ref}}/
Catalogue: https://${{github.event.pull_request.user.login}}.github.io/ramp4-pcar4/${{github.head_ref}}/demos/index-all.html
Samples: https://${{github.event.pull_request.user.login}}.github.io/ramp4-pcar4/${{github.head_ref}}/demos/index-samples.html
80 changes: 0 additions & 80 deletions .github/workflows/deploy.yml

This file was deleted.

77 changes: 0 additions & 77 deletions .github/workflows/main.yml

This file was deleted.

0 comments on commit 8b94a73

Please sign in to comment.