You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository uses different workflows to automatically updates the published websites
4
+
5
+
-<https://quarto.org/> - The documentation for Quarto, published from the `main` branch
6
+
-<https://prerelease.quarto.org/> - The documentation for Quarto prerelease, published from the `prerelease` branch
7
+
8
+
It also configures some website preview for pull requests, which are published to Netlify as deploy previews. The use non-production deploy and can be consulted to `deploy-preview-<PR number>.quarto.org`.
9
+
10
+
Note that technically, <prerelease.quarto.org> is also a deploy preview on Netlify (non-production website) but with a fixed URL.
11
+
12
+
## Workflow files: What they do
13
+
14
+
-`publish.yml` - The workflow that publishes the documentation from `main` and `prerelease` branches to netlify.
15
+
- For stable release version, the doc is deployed from `main`, and published using `quarto publish netlify` command to production website on Netlify.
16
+
- For prerelease version, the doc is deployed from `prerelease`, and published using Github Action `nwtgck/actions-netlify` which use Netlify API to deploy to a non-production website on Netlify.
17
+
The prerelease website is build using a specific profile at render time, set in action using `QUARTO_PROFILE` environment variable.
18
+
19
+
-`preview.yml` - The workflow that creates a deploy preview for pull requests. It uses the same action `nwtgck/actions-netlify` to deploy to a non-production website on Netlify. The URL is `deploy-preview-<PR number>.quarto.org`.
20
+
- PR previews are configured for any PR to `main` or`prerelease` branches.
21
+
- They are automically created and updated when the PR is created and updated by a user with Contributor role.
22
+
- For external PR, the preview can be triggered by adding a comment `/deploy-preview` on the PR.
23
+
- Any rendering to prerelease also uses a specific profile at render time, set in action using `QUARTO_PROFILE` environment variable.
24
+
25
+
-`update-downloads.yml` - This workflow is triggered by a cron schedule. It retrieves information about latest release and prerelease on `quarto-dev/quarto-cli` repository and updates the download links on the website.
26
+
- If there is a new version detected, it will commit the modified files and trigger a deploy of the website calling `publish.yml` workflow with `workflow_call` event trigger.
27
+
- This applies to both `main` and `prerelease` branches
28
+
- For `main` branch, we use `stefanzweifel/git-auto-commit-action` to detect changes and commit them to the `main` branch
29
+
- For `prerelease` branch, we use `git cherry-pick` the commit from main following previous above step.
30
+
- Then we trigger the `publish.yml` workflow with `workflow_call` event trigger for each of the branch.
31
+
32
+
-`upload-index.yml` - This workflow is triggered by a cron schedule. It updates the indexes for Algolia search engine, which powers the sites search.
33
+
-`search.json` is built when the website is rendered and then it is deployed to the website.
34
+
- This index file is retrieved on deployed website to be updated on Algolia.
35
+
- Both `quarto.org` and `prerelease.quarto.org` indexes are updated in the same run - they each use one specific algolia index
36
+
37
+
-`port-to-prerelease.yml` - This workflow is used to sync changes made to main for quarto.org to prerelease branch for prerelease.quarto.org.
38
+
- It is triggered when a PR is merged in to `main`. It can also be triggered manually by adding a comment `/sync-prerelease` on a merged PR.
39
+
- This workflow uses [`korthout/backport-action`](https://github.com/korthout/backport-action) to create a PR with the changes merged into `main` branch to be synced to `prerelease` branch.
40
+
- It will also write a new `/deploy-preview` comment in the new PR to trigger the preview deployment from `preview.yml`.
41
+
- This is possible because it uses a fine-grained PAT token which allows a workflow to trigger another using usual event (GITHUB_TOKEN does not allow that usually). This is configured in repo secrets.
42
+
43
+
## Netlify Configurations
44
+
45
+
- This repo has a `_redirects` file in the root directory. Otherwise, configuration are made in NETLIFY UI. Quarto website is inside Posit Netlify account.
46
+
- Automatic builds are turned off for this repo on Netlify because we currently need to render with Quarto CLI in Gihub Action CI before publishing the results.
47
+
- API deploy is used currently, using npm netlify package through `nwtgck/actions-netlify` github actions. One think to know: Netlify has removed `deploy()` function from its npm package in version 7 and recommends now to use Netlify CLI instead. But we are still using the package for now in CI, but also for `quarto publish netlify`.
48
+
- Deploy previews are possible with manual deploy using an alias configuration for the deploy command; This allows us to `deploy-preview-<PR number>` and `prerelease` alias to be used for the deploy previews.
49
+
- This means our netlify website don't use automatic builds and automatic Branch deploy - Only deploy previews.
50
+
- The website uses [Automatic Deploy Subdomains](https://docs.netlify.com/domains-https/custom-domains/automatic-deploy-subdomains/#use-a-new-custom-domain-for-your-automatic-deploy-subdomain) to have `prerelease.quarto.org` or `deploy-preview-<PR number>.quarto.org` working.
51
+
52
+
## Custom Domain
53
+
54
+
-`quarto.org` is registered in external registrar, but associated with Netlify DNS allowing use to use [custom domains](https://docs.netlify.com/domains-https/custom-domains/multiple-domains/).
# Be helpful with reviewer and remind them to trigger a deploy preview if the PR is from a fork.
@@ -17,13 +24,41 @@ jobs:
17
24
echo "::error title=Manual action required for preview::PR from fork can't be deployed as preview to Netlify automatically. Use '/deploy-preview' command in comments to trigger the preview manually."
18
25
shell: bash
19
26
27
+
role-of-commenter:
28
+
if: github.event.issue.pull_request
29
+
runs-on: ubuntu-latest
30
+
steps:
31
+
- name: Check if commenter is a member, owner or collaborator
32
+
id: commenter-check
33
+
env:
34
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
35
+
run: |
36
+
commenter_role=$(gh api repos/$GITHUB_REPOSITORY/collaborators/${{ github.event.comment.user.login }}/permission --jq '.permission')
0 commit comments