-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Changed comment action in deploy_to_github_pages workflow to access…
…-nri/actions/.github/actions/comment - Removed forked repos PRs from to the PR previews
- Loading branch information
1 parent
2683ecb
commit 230052d
Showing
1 changed file
with
5 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,30 +20,18 @@ permissions: | |
|
||
|
||
jobs: | ||
preview-setup: | ||
pr-preview-setup: | ||
# If the action is fired because of a PR, run this job | ||
if: ${{ github.event_name == 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up PR preview title | ||
# Set up infos for PR (new, updated or reopened branch not having a head as 'development' or 'main' branch) | ||
if: ${{ github.event.pull_request.head.ref != 'development' && github.event.pull_request.head.ref != 'main' }} | ||
run: | | ||
echo 'TITLE=PR preview' >> $GITHUB_ENV | ||
- name: Set up development preview title | ||
# Set up infos for PR (new, updated or reopened branch not having a head as 'development' or 'main' branch) | ||
if: ${{ github.event.pull_request.head.ref == 'development' }} | ||
run: | | ||
echo 'TITLE=Development website preview' >> $GITHUB_ENV | ||
- name: Get date | ||
run: echo "DATE=$(date '+%Y-%m-%d %H:%M %Z')" >> $GITHUB_ENV | ||
|
||
- name: Set up open PR message | ||
if: ${{ github.event.action != 'closed' }} | ||
run: | | ||
MULTI_LINES_TEXT="${{ env.TITLE }}\n | ||
MULTI_LINES_TEXT="PR Preview\n | ||
:---:\n | ||
🛫 Deployment still ongoing.<br> | ||
Preview URL will be available at the end of the deployment.\n | ||
|
@@ -66,11 +54,10 @@ jobs: | |
echo "EOF" >> $GITHUB_ENV | ||
- name: Set preview | ||
uses: thollander/actions-comment[email protected] | ||
uses: access-nri/actions/.github/actions/comment@main | ||
with: | ||
comment_tag: pr-preview | ||
pr_number: ${{ github.event.number }} | ||
message: ${{ env.MSG }} | ||
label: pr-preview | ||
|
||
build: | ||
# Cancel any previous build/deploy jobs that are still running (no need to build/deploy multiple times) | ||
|
@@ -114,7 +101,7 @@ jobs: | |
git checkout development | ||
mkdocs build -f mkdocs.yml -d ../website/development-website | ||
echo "Build PR websites" | ||
open_pr_info=$(gh pr list --json headRefOid,number,headRefName --jq '.[] | select(.headRefName!="development" and .headRefName!="main")') | ||
open_pr_info=$(gh pr list --json headRepositoryOwner,headRefOid,number,headRefName --jq '.[] | select(.headRefName!="development" and .headRefName!="main" and .headRepositoryOwner.login=="${{ github.repository_owner }}")') | ||
pr_nums=($(jq '.number' <<< "$open_pr_info")) | ||
pr_sha=($(jq -r '.headRefOid' <<< "$open_pr_info")) | ||
if [[ -n $pr_nums ]]; then | ||
|