Skip to content

Commit

Permalink
test update dev website
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuri05 authored and Yuri05 committed Feb 19, 2024
1 parent 19502ff commit 6b2ce43
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 1 deletion.
82 changes: 82 additions & 0 deletions .github/workflows/CreateGitHubPagesForR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Create GitHub pages for an R package

on:
workflow_call:
inputs:
pkgdown_mode:
required: true
type: string
enum: ['devel', 'release']
extra_r_packages:
required: false
type: string
gh-pages-branch:
required: false
type: string
default: 'gh-pages'

jobs:
build:
runs-on: windows-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
PKGDOWN_MODE: ${{ inputs.pkgdown_mode }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Setup Pandoc
uses: r-lib/actions/setup-pandoc@v2
- name: Install required packages
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: |
${{ inputs.extra_r_packages }}
any::pkgdown
local::.
needs: website
- name: Remove build number from the DESCRIPTION and build site
run: |
description <- readLines('DESCRIPTION')
versionLine <- grep(pattern = 'Version: [0-9]\\.[0-9]\\.[0-9]', description)
description[versionLine] <- gsub(pattern = '\\.[0-9]$', replacement = '', description[versionLine])
writeLines(description, 'DESCRIPTION')
options(yaml.eval.expr=TRUE)
pkgdown::build_site(devel=TRUE, install=TRUE)
shell: Rscript {0}
# The project is then uploaded as an artifact named 'docs'.
- name: Upload Artifacts
uses: actions/upload-artifact@v1
with:
name: docs
path: docs

deploy:
concurrency: ci-${{ github.ref }}
# The second job must depend on the first one to complete before running and uses ubuntu-latest instead of windows.
needs: [build]
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v4
# The built project is downloaded into the 'docs' folder.
- name: Download Artifacts
uses: actions/download-artifact@v1
with:
name: docs
- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
# The deployment folder should match the name of the artifact.
# Clean is false to prevent removing release site
# only target folder of repo from gh-pages branch is updated
with:
folder: docs
clean: false
branch: ${{ inputs.gh-pages-branch }}
target-folder: docs
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/update-dev-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:

jobs:
update_dev_website:
uses: Yuri05/Test04/edit/main/.github/workflows/CreateGitHubPagesForR.yml@main
uses: ./CreateGitHubPagesForR.yml #Yuri05/Test04/edit/main/.github/workflows/CreateGitHubPagesForR.yml@main
with:
pkgdown_mode: 'devel'
extra_r_packages: 'github::Open-Systems-Pharmacology/OSPSuite.RUtils'
Expand Down

0 comments on commit 6b2ce43

Please sign in to comment.