Skip to content

Commit

Permalink
Updated GitHub actions
Browse files Browse the repository at this point in the history
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
knoiva-indecon committed Nov 5, 2024
1 parent 61e6126 commit 4af3c4d
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 25 deletions.
24 changes: 1 addition & 23 deletions .github/workflows/test_fredi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
### For uploading artifacts:
### "path:" is the output path where Pandoc will write the compiled PDF.
### Note, this should be the same directory as the input paper.md
name: 3. Test FrEDI Package
name: 2a. Test FrEDI Package

on:
workflow_dispatch:
Expand All @@ -21,35 +21,13 @@ on:
options:
- no
- yes
# figH_results:
# type: choice
# description: Fig H results?
# required: true
# options:
# - no
# - yes
# make_appx_figs:
# type: choice
# description: Create appendix figures for report?
# required: true
# options:
# - no
# - yes
# make_tots_figs:
# type: choice
# description: Make figures for impact type totals?
# required: true
# options:
# - no
# - yes

jobs:
compile_data:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

# echo "${{ inputs.run_tests }} ${{ inputs.figH_results }} ${{ inputs.make_appx_figs }} ${{ inputs.make_tots_figs }}"
name: Load Package Code
steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_base_data.yml
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:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/update_github_pages.yml
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
2 changes: 1 addition & 1 deletion .github/workflows/update_sv_impactsList.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 2. Update SV ImpactsList Data (as needed)
name: 1c. Update SV ImpactsList Data (as needed)

on:
workflow_dispatch:
Expand Down

0 comments on commit 4af3c4d

Please sign in to comment.