-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
139902f
commit e29cf95
Showing
8 changed files
with
175 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,149 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
job: | ||
required: true | ||
type: string | ||
default: '' | ||
event_name: | ||
required: true | ||
type: string | ||
run_id: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
|
||
document: | ||
name: 📖 Check documentation is up to date | ||
if: ${{ inputs.job == 'document' }} | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- name: Install dependencies | ||
uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::roxygen2 | ||
needs: roxygen2 | ||
|
||
- name: Document | ||
run: roxygen2::roxygenise() | ||
shell: Rscript {0} | ||
|
||
- name: Commit and push changes | ||
run: | | ||
git config --local user.name "$GITHUB_ACTOR" | ||
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" | ||
git add man/\* NAMESPACE DESCRIPTION | ||
git commit -m "Update documentation" || echo "No changes to commit" | ||
git pull --ff-only | ||
git push origin | ||
lint: | ||
name: 🔎 Perform linting | ||
if: ${{ inputs.job == 'lint' }} | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::lintr, local::. | ||
needs: lint | ||
|
||
- name: Lint | ||
run: lintr::lint_package() | ||
shell: Rscript {0} | ||
env: | ||
LINTR_ERROR_ON_LINT: true | ||
|
||
|
||
|
||
cleanup: | ||
name: 🧼 Clean up environment | ||
if: ${{ inputs.job == 'pkgdown' && inputs.event_name == 'release' }} | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
|
||
steps: | ||
- name: 🗑 Delete previous deployments | ||
uses: strumwolf/delete-deployment-environment@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
environment: github-pages | ||
onlyRemoveDeployments: true | ||
|
||
pkgdown-build: | ||
name: 📖 Render pkgdown output | ||
if: ${{ inputs.job == 'pkgdown' }} | ||
runs-on: ubuntu-latest | ||
# Only restrict concurrency for non-PR jobs | ||
concurrency: | ||
group: pkgdown-${{ inputs.event_name != 'pull_request' || inputs.run_id }} | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
permissions: | ||
contents: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::pkgdown, local::. | ||
needs: website | ||
|
||
- name: Build site | ||
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) | ||
shell: Rscript {0} | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: pkgdown | ||
path: docs/ | ||
|
||
deploy: | ||
name: 🚀 Deploy to GitHub pages | ||
if: ${{ inputs.job == 'pkgdown' && inputs.event_name == 'release' }} | ||
runs-on: ubuntu-latest | ||
needs: [cleanup, pkgdown-build] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download pkgdown output | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: pkgdown | ||
path: docs | ||
|
||
- name: Deploy to GitHub pages | ||
uses: JamesIves/github-pages-deploy-action@v4.4.1 | ||
with: | ||
clean: false | ||
branch: gh-pages | ||
folder: docs |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branch: [main, master] | ||
pull_request: | ||
branch: [main, master] | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
name: Deploy to GitHub Pages | ||
|
||
jobs: | ||
cleanup-build-deploy: | ||
uses: ./.github/workflows/all_jobs.yaml | ||
with: | ||
jobs: ['pkgdown'] | ||
event_name: ${{ github.event_name }} | ||
run_id: ${{ github.run_id }} | ||
secrets: inherit |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters