Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pkgdown #1043

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 18 additions & 50 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [master]
issue_comment:
types: [created]
branches: [main, master]
pull_request:
release:
types: [published]
workflow_dispatch:

name: pkgdown
name: pkgdown.yaml

permissions: read-all

jobs:
pkgdown:
Expand All @@ -19,63 +20,30 @@ jobs:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
isPush: ${{ github.event_name == 'push' }}
isPR: ${{ github.event.issue.pull_request && startsWith(github.event.comment.body, '/pkgdown') }}

permissions:
contents: write
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Checkout Pull Request
if: contains(env.isPR, 'true')
run: hub pr checkout ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4

- uses: r-lib/actions/setup-pandoc@v2

- name: Setup R
uses: r-lib/actions/setup-r@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- name: Install dependencies
uses: r-lib/actions/setup-r-dependencies@v2
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Install package
run: R CMD INSTALL .

- name: Build and deploy pkgdown site to GitHub pages 🚀
if: contains(env.isPush, 'true')
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

- name: Create website
if: contains(env.isPR, 'true')
run: |
pkgdown::build_site()
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Create index file
if: contains(env.isPR, 'true')
run: |
echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0;URL=/dev/index.html" /> <script language="javascript"> window.location.replace('/dev/index.html')</script></head></html>' > ./docs/index.html

- name: Deploy to Netlify
if: contains(env.isPR, 'true')
id: netlify-deploy
uses: nwtgck/actions-netlify@v3
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/[email protected]
with:
publish-dir: './docs'
production-branch: main-R
github-token: ${{ secrets.GITHUB_TOKEN }}
deploy-message:
'Deploy from GHA: ${{ github.event.pull_request.title || github.event.head_commit.message }} (${{ github.sha }})'
timeout-minutes: 12
clean: false
branch: gh-pages
folder: docs
197 changes: 0 additions & 197 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,200 +3,3 @@
url: https://public-health-scotland.github.io/source-linkage-files
template:
bootstrap: 5

reference:

- title: Connection to PHS database
desc: Connection to PHS database
- contents:
- phs_db_connection


- title: Check
desc: Checks within vectors
- contents:
- is_missing
- check_variables_exist
- check_year_valid
- check_it_reference


- title: Years & Dates
- subtitle: Dates within Financial Year
desc: Functions to compute the start, end and midpoint dates of a financial year, and convert date types
- contents:
- has_concept("date functions")
- ends_with("_fy")
- fy_interval
- contains("_date")
- subtitle: Year Format
desc: Functions to convert between financial year and calendar year, and check that the year variable is in the correct format
- contents:
- has_concept("year functions")
- ends_with("year")
- contains("year_format")
- subtitle: Ages
desc: Functions to deal with ages of clients
- contents:
- contains("_age")


- title: Clean-Up
desc: Clean up the data
- contents:
- starts_with("clean_up")
- fill_ch_names
- cascade_geographies
- correct_demographics


- title: Create
- subtitle: ID
desc: Functions to create ID variables
- contents:
- has_concept("id functions")
- contains("_id")
- subtitle: Costs
desc: Functions to create costs variables and fix costs
- contents:
- ends_with("_costs")
- subtitle: Flags
desc: Functions to create flag variables
- contents:
- has_concept("flag functions")
- ends_with("_flags")
- subtitle: Monthly
desc: Functions to convert monthly variables, beddays
- contents:
- contains("_monthly_rows")
- contains("_beddays")


- title: Codes
desc: Convert various codes to alternate forms
- contents:
- has_concept("code functions")
- has_concept("Codes")
- contains("_to_lca")
- contains("to_dummy")
- contains("_hb_to")
- contains("_hscp_to")
- contains("_chi")
- contains("lca")
- la_code_lookup

- title: Writing data
desc: Functions which mask the typical data write functions to add some nice defaults and importantly fix file permissions.
- contents:
- write_file


- title: Initialisation
desc: Get the date of update, period, and extract number
- contents:
- has_concept("initialisation")
- ends_with("_period")
- ends_with("_update")
- starts_with("it_extract")
- gzip_files
- make_lowercase_ext


- title: Files
- subtitle: Directories
desc: File Directories for SLF's
- contents:
- has_concept("directories")
- ends_with("_dir")
- subtitle: Paths
desc: File Paths for SLF's
- contents:
- has_concept("file path functions")
- has_concept("lookup file paths")
- has_concept("slf lookup file paths")
- has_concept("costs lookup file paths")
- has_concept("extract file paths")
- has_concept("social care lookup file paths")
- has_concept("social care episodes file paths")
- has_concept("cohort lookup file paths")
- ends_with("_file")
- ends_with("_path")

- title: Read extracts
desc: Process SLF Extracts
- contents:
- has_concept("read extracts")
- starts_with("read_")
- get_gpprac_opendata


- title: Process extracts
desc: Process SLF Extracts
- contents:
- has_concept("process extracts")
- starts_with("process_")


- title: Episode file
desc: Building the episode file
- contents:
- has_concept("episode_file")
- fill_geographies
- subtitle: Lookups
- contents:
- has_concept("Demographic and Service Use Cohort functions")
- join_sparra_hhg
- join_deaths_data
- join_sc_client
- match_on_ltcs


- title: Individual file
desc: Building the episode file
- contents:
- has_concept("individual_file")
- subtitle: Lookups
- contents:
- has_concept("Demographic and Service Use Cohort functions")
- join_sparra_hhg
- join_cohort_lookups
- join_deaths_data
- join_slf_lookup_vars
- match_on_ltcs

- title: Demographics
desc: Things related to demographic lookups
- contents:
- fill_geographies
- get_gpprac_opendata
- make_gpprac_lookup
- make_postcode_lookup
- recode_health_boards
- recode_hscp
- la_code_lookup


- title: Miscellaneous functions
desc: Miscellaneous functions.
- subtitle: Homelessness
- contents:
- fix_east_ayrshire_duplicates
- fix_west_dun_duplicates
- produce_homelessness_completeness
- subtitle: Helper functions
- contents:
- vars_end_with
- has_concept("helper_funs")


- title: Testing
desc: Tests for the SLF Extracts
- contents:
- has_concept("test functions")
- has_concept("extract test functions")
- has_concept("slf test functions")
- has_concept("social care test functions")
- contains("_tests")
- contains("_measures")
- starts_with("produce_test")

Loading