diff --git a/.github/workflows/test_fredi.yml b/.github/workflows/test_fredi.yml index c5b6f0fb..0c6bc1a7 100644 --- a/.github/workflows/test_fredi.yml +++ b/.github/workflows/test_fredi.yml @@ -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: @@ -21,27 +21,6 @@ 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: @@ -49,7 +28,6 @@ jobs: 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 diff --git a/.github/workflows/update_base_data.yml b/.github/workflows/update_base_data.yml index 81a67fd1..5428422a 100644 --- a/.github/workflows/update_base_data.yml +++ b/.github/workflows/update_base_data.yml @@ -1,4 +1,4 @@ -name: 1. Update Base System Data +name: 1a. Update Base System Data on: workflow_dispatch: diff --git a/.github/workflows/update_github_pages.yml b/.github/workflows/update_github_pages.yml new file mode 100644 index 00000000..3416056f --- /dev/null +++ b/.github/workflows/update_github_pages.yml @@ -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 diff --git a/.github/workflows/update_sv_impactsList.yml b/.github/workflows/update_sv_impactsList.yml index c2c0f514..86c95466 100644 --- a/.github/workflows/update_sv_impactsList.yml +++ b/.github/workflows/update_sv_impactsList.yml @@ -1,4 +1,4 @@ -name: 2. Update SV ImpactsList Data (as needed) +name: 1c. Update SV ImpactsList Data (as needed) on: workflow_dispatch: