Merge pull request #6377 from menloresearch/ci/update-paths-jan-server-web
ci: add paths for jan server web
This commit is contained in:
commit
49ca18ca6b
46
.github/workflows/jan-server-web-ci.yml
vendored
46
.github/workflows/jan-server-web-ci.yml
vendored
@ -4,9 +4,27 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/jan-server-web-ci.yml'
|
||||||
|
- 'core/**'
|
||||||
|
- 'web-app/**'
|
||||||
|
- 'extensions/**'
|
||||||
|
- 'extensions-web/**'
|
||||||
|
- 'Makefile'
|
||||||
|
- 'package.json'
|
||||||
|
- 'Dockerfile'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- dev
|
- dev
|
||||||
|
paths:
|
||||||
|
- '.github/workflows/jan-server-web-ci.yml'
|
||||||
|
- 'core/**'
|
||||||
|
- 'web-app/**'
|
||||||
|
- 'extensions/**'
|
||||||
|
- 'extensions-web/**'
|
||||||
|
- 'Makefile'
|
||||||
|
- 'package.json'
|
||||||
|
- 'Dockerfile'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-preview:
|
build-and-preview:
|
||||||
@ -34,9 +52,7 @@ jobs:
|
|||||||
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
|
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
|
||||||
&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
|
&& sudo mkdir -p -m 755 /etc/apt/sources.list.d \
|
||||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
|
||||||
&& sudo apt update \
|
&& sudo apt update
|
||||||
&& sudo apt install gh -y
|
|
||||||
sudo apt-get update
|
|
||||||
sudo apt-get install -y jq gettext
|
sudo apt-get install -y jq gettext
|
||||||
|
|
||||||
- name: Set image tag and service name
|
- name: Set image tag and service name
|
||||||
@ -95,23 +111,7 @@ jobs:
|
|||||||
if: github.event_name == 'pull_request'
|
if: github.event_name == 'pull_request'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
run: |
|
uses: mshick/add-pr-comment@v2
|
||||||
DOMAIN="https://pr-${{ github.sha }}-${{ steps.vars.outputs.SERVICE_NAME }}.menlo.ai"
|
with:
|
||||||
COMMENT_BODY="🌐 Preview available: [${DOMAIN}](${DOMAIN})"
|
message: |
|
||||||
|
Preview URL: https://pr-${{ github.sha }}-${{ steps.vars.outputs.SERVICE_NAME }}.menlo.ai
|
||||||
echo "🔍 Looking for existing preview comment..."
|
|
||||||
|
|
||||||
COMMENT_ID=$(gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
|
|
||||||
--jq '.[] | select(.user.login=="github-actions[bot]") | select(.body | contains("<!-- preview-url -->")) | .id')
|
|
||||||
|
|
||||||
if [[ -n "$COMMENT_ID" ]]; then
|
|
||||||
echo "✏️ Updating existing comment ID $COMMENT_ID"
|
|
||||||
gh api repos/${{ github.repository }}/issues/comments/${COMMENT_ID} \
|
|
||||||
--method PATCH \
|
|
||||||
--field "body=${COMMENT_BODY}"
|
|
||||||
else
|
|
||||||
echo "💬 Creating new comment"
|
|
||||||
gh api repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
|
|
||||||
--method POST \
|
|
||||||
--field "body=${COMMENT_BODY}"
|
|
||||||
fi
|
|
||||||
Loading…
x
Reference in New Issue
Block a user