Skip to content

Commit

Permalink
Trigger the preview build when labeled (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccarouge committed Oct 5, 2022
1 parent 70a7be0 commit 73cb30b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Deploy PR preview
on:
pull_request:
types:
- opened
- reopened
- labeled
- synchronize
- closed

Expand All @@ -28,6 +27,7 @@ permissions:
jobs:
deploy-preview:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'safe to test')
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -46,6 +46,6 @@ jobs:
mkdocs build -f mkdocs.yml -d site
- name: Deploy preview
uses: rossjrw/pr-preview-action@v1
uses: access-nri/pr-preview-action@v1.1
with:
source-dir: site
6 changes: 3 additions & 3 deletions docs/about/contribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ When you click on this icon, your browser will open the file in GitHub allowing
The `main` branch of the repository is protected and nobody can write to it directly. You will need to choose either to create a new branch and open a pull request if you are a member of ACCESS-Hive organisation, or to create a fork on your personal account and open a pull request if you are not a member of ACCESS-Hive organisation.
![BranchAndPR](../assets/branch-and-pr.png)

When creating the pull request, make sure to add the text: `Closes #X` to the description, where X is the issue number related to this change. This will link the pull request and the issue together and the issue will be automatically closed once the pull request is accepted. The pull request will also automatically build [a preview of the documentation with your proposed changes][preview].
When creating the pull request, make sure to add the text: `Closes #X` to the description, where X is the issue number related to this change. This will link the pull request and the issue together and the issue will be automatically closed once the pull request is accepted.

Then ask for a review by tagging the `@ACCESS-Hive/reviewers` team in a comment.
Then ask for a review by tagging the `@ACCESS-Hive/reviewers` team in a comment. Once the pull request is being reviewed, the reviewer will trigger [a preview of the documentation with your proposed changes][preview].

You will be notified by email of any subsequent comment, request or action from the reviewer on this pull request. Please make sure you take any action required by the reviewer or your modification will not be accepted into the ACCESS-Hive site.

Expand Down Expand Up @@ -127,7 +127,7 @@ Your documentation will be built on http://127.0.0.1:8000. Open this URL in your

### Preview of the documentation

When a pull request is opened or updated, GitHub will automatically build a preview of the documentation that includes the proposed changes. This can be used instead of local updates by setting your pull request as a draft for example.
When a pull request is labeled during the review process, GitHub will automatically build a preview of the documentation that includes the proposed changes. The preview will not build until a reviewer has labeled the pull request as safe to test.

In the pull request, you will see the link to the preview appear in this fashion:

Expand Down

0 comments on commit 73cb30b

Please sign in to comment.