From 142f04bfa59636ecc41870652cab207bc2f098ee Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Mon, 6 Jan 2025 11:12:39 -0600 Subject: [PATCH] enable pages, and quote the action path only but not `*` --- .github/workflows/github-pages.yml | 2 ++ docs/07-site.Rmd | 10 +++++++++- site/action.yml | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml index 81cf266..9d13e34 100644 --- a/.github/workflows/github-pages.yml +++ b/.github/workflows/github-pages.yml @@ -18,6 +18,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/configure-pages@v5 + with: + enablement: true - uses: r-lib/actions/setup-r@HEAD with: use-public-rspm: true diff --git a/docs/07-site.Rmd b/docs/07-site.Rmd index d3a6bca..dc28b3a 100644 --- a/docs/07-site.Rmd +++ b/docs/07-site.Rmd @@ -162,7 +162,15 @@ You may use GitHub Actions to automatically build and deploy package websites. The key is to call `litedown::fuse_site()`. I have provided [a simple GitHub action](https://github.com/yihui/litedown/blob/main/site/action.yml) in the **litedown** repository, and you can add a step `uses: yihui/litedown/site@HEAD` -to your GitHub workflow to use it. Below is [the full +to your GitHub workflow to use it. + +::: callout-note +Remember to enable the deployment of GitHub Pages via GitHub Actions in your +repository settings (`Settings` → `Pages` → `Build and deployment` → `Source` → +`GitHub Actions`). +::: + +Below is [the full workflow](https://github.com/yihui/litedown/blob/main/.github/workflows/github-pages.yml) for building and publishing **litedown**'s site to GitHub Pages: diff --git a/site/action.yml b/site/action.yml index e4dea02..7e7e96e 100644 --- a/site/action.yml +++ b/site/action.yml @@ -29,7 +29,7 @@ runs: cd "${{ inputs.pkg-root }}" mkdir -p "${{ inputs.site-dir }}" cd "${{ inputs.site-dir }}" - [ -z "$(ls -A)" ] && cp -r "${{ github.action_path }}/*" ./ + [ -z "$(ls -A)" ] && cp -r "${{ github.action_path }}"/* ./ [ -f "_footer.Rmd" ] && Rscript -e "litedown::fuse('_footer.Rmd', '.md')" rm -f ${{ inputs.exclude }} Rscript -e "litedown::fuse_site()"