-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-numbered YML actions for: * Adding data from the FrEDI repo to be substeps of a first step. * Testing FrEDI to be a second step Also: Initialized action for updating GitHub pages
- Loading branch information
1 parent
61e6126
commit 4af3c4d
Showing
4 changed files
with
74 additions
and
25 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 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: 1. Update Base System Data | ||
name: 1a. Update Base System Data | ||
|
||
on: | ||
workflow_dispatch: | ||
|
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,71 @@ | ||
# Instructions for FrEDI website with pkgdown | ||
# | ||
# From FrEDI ‘main’ branch: | ||
# 1) If you haven’t run before: | ||
# Run ‘use_pkgdown_github_pages() – run when the R session working directory is set to the FrEDI R package folder. Only need to run once. This will do a lot of the initial set-up of configuration files and the github action workflows | ||
# | ||
# 2) If you have run before, do the following: | ||
# a) library(pkgdown) | ||
# b) setwd("~/CCD-CSIB/GitHub/Code/FrEDI/FrEDI") (set to FrEDI package location) | ||
# c) Run build_site_github_pages(lazy=TRUE,dest_dir = "../docs/") | ||
# Or | ||
# build_site_github_pages(lazy=TRUE,dest_dir = "../docs/",clean = FALSE) | ||
# | ||
# run this from inside the FrEDI R package folder on ‘main’ or and new branch. This will write to the ./docs folder in the root directory of main, all the information needed to build the site. Then set Github pages to look in that directory (only needs to be done once when setting up the IO page). | ||
# | ||
# (Update the vignettes/articles/Example scripts as needed) | ||
# | ||
# 3) After code is run, commit changes to main and push to github so that the site changes can become live. | ||
# | ||
# This process requires the user to manually re-build the site following step 2 every time there are updates to the code that we want reflected on the IO site. | ||
name: 5. Update GitHub Pages | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update_github_pages: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
name: Load Package Code | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup R | ||
uses: r-lib/actions/setup-r@v2 | ||
|
||
- name: Setup R package dependencies | ||
uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
cache: true | ||
cache-version: 1 | ||
packages: | | ||
any::tidyverse | ||
any::ggpubr | ||
any::openxlsx | ||
any::devtools | ||
any::zoo | ||
any::pkgdown | ||
- name: Build documentation | ||
run: | | ||
Rscript -e ' | ||
###### Paths ###### | ||
### Main repo path, FrEDI project path, scripts path | ||
require(pkgdown) | ||
rPath0 <- "."; | ||
docPath0 <- rPath0 |> file.path("docs") | ||
build_site_github_pages(lazy=TRUE, dest_dir=docPath0, clean=FALSE) | ||
' | ||
- name: Commit results | ||
run: | | ||
git config --local core.autocrlf false | ||
git config --local user.email "${{ github.actor }}@users.noreply.github.com" | ||
git config --local user.name "${{ github.actor }}" | ||
git add ./docs/* | ||
git pull origin ${{ github.head_ref }} --autostash --rebase -X ours | ||
git commit -am "Updated GitHub pages" | ||
git push |
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