Skip to content

Commit 0e5c0a1

Browse files
committed
allow 'target' as alias for 'to' in publish action
1 parent a194632 commit 0e5c0a1

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

examples/example-05-non-top-level.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ It's possible to have a quarto project in a large GitHub repository, where the q
66
- name: Publish to GitHub Pages (and render)
77
uses: quarto-dev/quarto-actions/publish@v2
88
with:
9-
to: gh-pages
9+
target: gh-pages
1010
path: subdirectory-to-use
1111
```

examples/example-06-no-render.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ to the `publish` action:
99
- name: Publish to GitHub Pages (and render)
1010
uses: quarto-dev/quarto-actions/publish@v2
1111
with:
12-
to: gh-pages
12+
target: gh-pages
1313
render: false
1414
```
1515

examples/quarto-publish-example.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
on:
22
push:
33
branches: main
4-
5-
# TODO test PR trigger
6-
# pull_request:
7-
# branches: main
84

95
name: Render and Publish
106

@@ -31,20 +27,20 @@ jobs:
3127
# - name: Publish to Netlify (and render)
3228
# uses: quarto-dev/quarto-actions/publish@v2
3329
# with:
34-
# to: netlify
30+
# target: netlify
3531
# NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
3632

3733
# - name: Publish to RStudio Connect (and render)
3834
# uses: quarto-dev/quarto-actions/publish@v2
3935
# with:
40-
# to: connect
36+
# target: connect
4137
# CONNECT_SERVER: enter-the-server-url-here
4238
# CONNECT_API_KEY: ${{ secrets.CONNECT_API_KEY }}
4339

4440
# - name: Publish to GitHub Pages (and render)
4541
# uses: quarto-dev/quarto-actions/publish@v2
4642
# with:
47-
# to: gh-pages
43+
# target: gh-pages
4844
# env:
4945
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # this secret is always available for github actions
5046

publish/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Give this token a memorable name, and note the resulting string (or keep this wi
1515
- name: Publish to Netlify (and render)
1616
uses: quarto-dev/quarto-actions/publish@v2
1717
with:
18-
to: netlify
18+
target: netlify
1919
```
2020
2121
## GitHub Pages
@@ -28,7 +28,7 @@ Give this token a memorable name, and note the resulting string (or keep this wi
2828
- name: Publish to GitHub Pages (and render)
2929
uses: quarto-dev/quarto-actions/publish@v2
3030
with:
31-
to: gh-pages
31+
target: gh-pages
3232
```
3333
3434
## RStudio Connect
@@ -47,7 +47,7 @@ Give this token a memorable name, and note the resulting string (or keep this wi
4747
- name: Publish to Netlify (and render)
4848
uses: quarto-dev/quarto-actions/publish@v2
4949
with:
50-
to: gh-pages
50+
target: gh-pages
5151
```
5252

5353

publish/action.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ inputs:
55
to:
66
description: 'Service to publish to. If unspecified, use the default value derived from _publish.yml'
77
required: false
8+
target:
9+
description: 'Alias for `to`. If unspecified, use the default value derived from _publish.yml'
10+
required: false
811
CONNECT_SERVER:
912
description: 'RStudio Connect server. If unspecified, use the default value derived from _publish.yml'
1013
required: false
@@ -42,8 +45,12 @@ runs:
4245
run: |
4346
git config --global user.email "${{ inputs.GITHUB_EMAIL }}"
4447
git config --global user.name "${{ inputs.GITHUB_USERNAME }}"
48+
TARGET="${{ inputs.to }}"
49+
if [ "$TARGET" == "" ]; then
50+
TARGET="${{ inputs.target }}"
51+
fi
4552
if [ "${{ inputs.render }}" != "true" ]; then
46-
quarto publish ${{ inputs.to }} ${{ inputs.path }} --no-render
53+
quarto publish $TARGET ${{ inputs.path }} --no-render
4754
else
48-
quarto publish ${{ inputs.to }} ${{ inputs.path }}
55+
quarto publish $TARGET ${{ inputs.path }}
4956
fi

0 commit comments

Comments
 (0)