Skip to content

Commit d64c8b0

Browse files
jakobarendtcderv
andauthored
Improve examplary YAML file and correct typos (#83)
Co-authored-by: Christophe Dervieux <[email protected]>
1 parent 408c6ba commit d64c8b0

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
This repository stores [Github Actions](https://github.com/features/actions) useful for building and publishing [Quarto](https://quarto.org/) documents.
44

5-
1. [quarto-dev/quarto-actions/setup](https://github.com/quarto-dev/quarto-actions/tree/main/setup) - Install Quarto
6-
2. [quarto-dev/quarto-actions/render](https://github.com/quarto-dev/quarto-actions/tree/main/render) - Render project
7-
3. [quarto-dev/quarto-actions/publish](https://github.com/quarto-dev/quarto-actions/tree/main/publish) - Publish project
5+
1. [quarto-dev/quarto-actions/setup](./setup) - Install Quarto
6+
2. [quarto-dev/quarto-actions/render](./render) - Render project
7+
3. [quarto-dev/quarto-actions/publish](./publish) - Publish project
88

99
We recommend using `v2` for your actions, and our examples all use `v2`.
1010

1111
## Examples
1212

13-
In [Examples](./examples), you will find some YAML workflow files to serve as templates to be reused as a base for your project. We are also sharing some links to real example Github repositories using Quarto with Github Actions for rendering and deploying documents and projects. If you want to add your repository in the list, we welcome a PR.
13+
In [Examples](./examples), you will find a YAML workflow file to serve as a template to be reused as a base for your project. We are also sharing some links to real example Github repositories using Quarto with Github Actions for rendering and deploying documents and projects. If you want to add your repository in the list, we welcome a PR.
1414

1515
## Release Management
1616

1717
This repository uses [GitHub's recommended release management for actions](https://docs.github.com/en/actions/creating-actions/about-custom-actions#using-release-management-for-actions):
1818

1919
* GitHub releases with tags are used for updates on the actions.
2020
* Semantic versioning is used, with major, minor and possibly patch release.
21-
* Major versions (such as `v1`) will always point to the last minor or patch release for this major version. (when `v1.0.2` is out, `v1` will point to this update to). This means using `quarto-dev/quarto-actions/setup@v2` in your workflow file will automatically get the updated versions. Using `quarto-dev/quarto-actions/[email protected]` will pin a specific release.
21+
* Major versions (such as `v1`) will always point to the last minor or patch release for this major version. (when `v1.0.2` is out, `v1` will point to this update, too). This means using `quarto-dev/quarto-actions/setup@v2` in your workflow file will automatically get the updated versions. Using `quarto-dev/quarto-actions/[email protected]` will pin a specific release.
2222
* Major version changes (`v1` to `v2`) will often come with breaking changes, and workflows might require manual updates.

examples/example-01-basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The simplest workflow using Quarto Actions uses the `setup` and `publish` action
66

77
1. **Add the GitHub Actions workflow to your project**
88

9-
Copy [quarto-publish-example.yml](quarto-publish-example.yml) to `.github/workflows/quarto-publish.yml`. Uncomment the "Publish to GitHub Pages (and render)" action. No further changes are needed to the action (in particular, do *not* edit the line below to add a secret to this file. This file has the same permissions as your repository, and might be publicly readable)
9+
Copy [quarto-publish-example.yml](quarto-publish-example.yml) to `.github/workflows/quarto-publish.yml`. Uncomment the "Publish to GitHub Pages (and render)" action. Do *not* edit the line below to add a secret to this file. Also uncomment the minimum required access permissions; a general change in your repository's settings for GitHub actions permissions is **not needed**.
1010

1111
2. **run `quarto publish gh-pages` locally, once**
1212

examples/quarto-publish-example.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ name: Render and Publish
1212
jobs:
1313
build-deploy:
1414
runs-on: ubuntu-latest
15+
1516
steps:
1617
- name: Check out repository
1718
uses: actions/checkout@v4

publish/README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Give this token a memorable name, and note the resulting string (or keep this wi
55

66
2. Add Netlify auth token to your repository's secrets. Go to the repository that will be using this GHA. Click on "Settings". On the new page, click on "Secrets", then on the dropdown "Actions". Now, on the right-hand tab, click on the "New repository secret" button to the right of the title "Actions secrets". For the "Name" field, use `NETLIFY_AUTH_TOKEN`, and for the "Value" field, paste the string you got from step 1.
77

8-
3. Add the GitHub Actions workflow to your project. (Use [quarto-publish-example.yml](https://github.com/quarto-dev/quarto-actions/blob/main/examples/quarto-publish-example.yml) as an example).
8+
3. Add the GitHub Actions workflow to your project. (Use [quarto-publish-example.yml](../examples/quarto-publish-example.yml) as an example).
99

1010
4. Add `_publish.yml` to your repository. Quarto stores publishing metadata information in `_publish.yml`. To create this file, run `quarto publish netlify` locally once.
1111

@@ -21,7 +21,7 @@ Give this token a memorable name, and note the resulting string (or keep this wi
2121
2222
## GitHub Pages
2323
24-
1. Add the GitHub Actions workflow to your project. (Use [quarto-publish-example.yml](https://github.com/quarto-dev/quarto-actions/blob/main/examples/quarto-publish-example.yml) as an example).
24+
1. Add the GitHub Actions workflow to your project. (Use [quarto-publish-example.yml](../examples/quarto-publish-example.yml) as an example).
2525
2626
2. Head over to your repository on GitHub. Under Settings > Pages > Build and deployment, under source, ensure **Deploy from a branch** is selected. Under the branch option, select the root of the gh-pages branch.
2727
@@ -34,6 +34,15 @@ Give this token a memorable name, and note the resulting string (or keep this wi
3434
uses: quarto-dev/quarto-actions/publish@v2
3535
with:
3636
target: gh-pages
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # this secret is always available for github actions
39+
```
40+
41+
5. Configure the minimum required access for the `publish` action to function (see also [quarto-publish-example.yml]()). Add these two lines below and on the same level of indentation as `runs-on:`:
42+
43+
```yaml
44+
permissions:
45+
contents: write
3746
```
3847

3948
## Posit Connect
@@ -42,7 +51,7 @@ Give this token a memorable name, and note the resulting string (or keep this wi
4251

4352
2. Add Posit Connect auth token to your GitHub repository. Go to the GitHub webpage for the repository that will be using this GitHub Action. Click on "Settings". On the new page, click on "Secrets", then on the dropdown "Actions". Now, on the right-hand tab, click on the "New repository secret" button to the right of the title "Actions secrets". For the "Name" field, use `CONNECT_API_KEY`, and for the "Value" field, paste the string you got from step 1.
4453

45-
3. Add the GitHub Actions workflow to your project. (Use [quarto-publish-example.yml](https://github.com/quarto-dev/quarto-actions/blob/main/examples/quarto-publish-example.yml) as an example).
54+
3. Add the GitHub Actions workflow to your project. (Use [quarto-publish-example.yml](../examples/quarto-publish-example.yml) as an example).
4655

4756
4. Add `_publish.yml` to your repository. Quarto stores publishing metadata information in `_publish.yml`. To create this file, run `quarto publish connect` locally once.
4857

0 commit comments

Comments
 (0)