Skip to content

Commit eb02b76

Browse files
authored
Merge pull request #432 from cmu-delphi/netlify2
ci(netlify): add comments, simplify, fix
2 parents 604173a + 5570cf4 commit eb02b76

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

.github/workflows/doc-preview.yaml

+21-11
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,15 @@ jobs:
1212

1313
runs-on: ubuntu-latest
1414
permissions:
15+
# Needed to write a comment on the PR
1516
pull-requests: write
16-
contents: write
17+
# Needed to read the PR branch
18+
contents: read
1719
steps:
18-
- name: Get PR number
19-
id: pr
20-
run: |
21-
PR_NUM=$(echo "${{ github.event.issue.number }}")
22-
echo "number=$PR_NUM" >> $GITHUB_OUTPUT
23-
2420
- uses: actions/checkout@v4
2521
with:
26-
ref: refs/pull/${{ steps.pr.outputs.number }}/head
22+
# Checkout the PR branch
23+
ref: refs/pull/${{ github.event.issue.number }}/head
2724

2825
- uses: r-lib/actions/setup-pandoc@v2
2926

@@ -43,13 +40,26 @@ jobs:
4340
- name: Deploy to Netlify
4441
uses: nwtgck/[email protected]
4542
with:
46-
publish-dir: './docs'
47-
production-deploy: false
43+
# Standard config
4844
github-token: ${{ secrets.GITHUB_TOKEN }}
4945
deploy-message: "Deploy from GitHub Actions"
46+
# 'docs/' is the default directory for pkgdown::build_site()
47+
# we add 'dev' because _pkgdown.yml has 'development: mode: devel'
48+
publish-dir: './docs/dev'
49+
# Development deploys only
50+
production-deploy: false
51+
# Enable pull request comment (default)
52+
enable-pull-request-comment: true
53+
# Overwrite the pull request comment with updated link (default)
54+
overwrites-pull-request-comment: true
55+
# Don't deploy to GitHub
5056
enable-github-deployment: false
57+
# Don't update the status of the commit
5158
enable-commit-status: false
59+
# Don't comment on the commit
60+
enable-commit-comment: false
5261
env:
62+
# Netlify credentials (currently from Dmitry's account)
5363
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
5464
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
55-
timeout-minutes: 1
65+
timeout-minutes: 1

0 commit comments

Comments
 (0)