From 48f74cd40fbed9b1c91413275306f93196296f9b Mon Sep 17 00:00:00 2001 From: Elliot Gould Date: Mon, 6 Nov 2023 15:41:53 +1100 Subject: [PATCH] setup pkgdown:: usethis gh actions workflow --- .Rbuildignore | 1 + .github/.gitignore | 1 + .github/workflows/pkgdown.yaml | 48 +++++++++++ DESCRIPTION | 3 +- _pkgdown.yml | 142 ++++++++++++++++----------------- 5 files changed, 123 insertions(+), 72 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/pkgdown.yaml diff --git a/.Rbuildignore b/.Rbuildignore index 2b7a44b..7262b5f 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -8,3 +8,4 @@ _targets.R ^_pkgdown\.yml$ ^docs$ ^pkgdown$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..ed7650c --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,48 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: + +name: pkgdown + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.4.1 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/DESCRIPTION b/DESCRIPTION index 350c2cb..1ff7ae7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -68,5 +68,6 @@ Encoding: UTF-8 LazyData: true Roxygen: list(markdown = TRUE) RoxygenNote: 7.2.3 -URL: https://github.com/egouldo/ManyEcoEvo +URL: https://github.com/egouldo/ManyEcoEvo, + https://egouldo.github.io/ManyEcoEvo/ BugReports: https://github.com/egouldo/ManyEcoEvo/issues diff --git a/_pkgdown.yml b/_pkgdown.yml index b471c2a..0244712 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,82 +1,82 @@ -url: ~ +url: https://egouldo.github.io/ManyEcoEvo/ template: bootstrap: 5 reference: -- title: "Unprocessed data cleaning and checking" - desc: "Functions for cleaning and QA checking unprocessed analyst data" -- subtitle: "Miscellaneous cleaning functions" +- title: Unprocessed data cleaning and checking + desc: Functions for cleaning and QA checking unprocessed analyst data +- subtitle: Miscellaneous cleaning functions contents: - - rm_inf_na - - anonymise_teams - - clean_response_transformation - - assign_transformation_type -- subtitle: "Working with analyst-provided out-of-sample predictions" - desc: + - rm_inf_na + - anonymise_teams + - clean_response_transformation + - assign_transformation_type +- subtitle: Working with analyst-provided out-of-sample predictions + desc: ~ contents: - - augment_prediction_data - - preprocess_prediction_files - - preprocess_updated_prediction_files - - read_submission_data - - starts_with("validate_predictions") -- title: "Data Processing for Meta-analysis and Modelling" - desc: "Calculating and standardising variables for analysis" + - augment_prediction_data + - preprocess_prediction_files + - preprocess_updated_prediction_files + - read_submission_data + - starts_with("validate_predictions") +- title: Data Processing for Meta-analysis and Modelling + desc: Calculating and standardising variables for analysis contents: - - est_to_zr - - Z_VZ_preds - - pred_to_Z - - apply_VZ_exclusions - - box_cox_transform - - log_transform - - calculate_deviation_score - - calculate_sorensen_diversity_index - - apply_sorensen_calc - - conversion - - conversion_2 - - convert_predictions - - ends_with("_back") - - back_transform_response_vars_yi - - starts_with("exclude_") - - starts_with("subset_fns") - - standardise_response -- title: "Process and create datasets for analysis" - desc: "Functions for creating datasets ready for meta-analysis or other analyses" + - est_to_zr + - Z_VZ_preds + - pred_to_Z + - apply_VZ_exclusions + - box_cox_transform + - log_transform + - calculate_deviation_score + - calculate_sorensen_diversity_index + - apply_sorensen_calc + - conversion + - conversion_2 + - convert_predictions + - ends_with("_back") + - back_transform_response_vars_yi + - starts_with("exclude_") + - starts_with("subset_fns") + - standardise_response +- title: Process and create datasets for analysis + desc: Functions for creating datasets ready for meta-analysis or other analyses contents: - - make_param_table - - compute_MA_inputs - - compute_metaanalysis_inputs - - get_diversity_data - - starts_with("prepare_") -- title: "Model Fitting & Meta-analysis" - desc: "Functions for fitting meta-analysis and other models described ion *Gould et al. (2023)*" + - make_param_table + - compute_MA_inputs + - compute_metaanalysis_inputs + - get_diversity_data + - starts_with("prepare_") +- title: Model Fitting & Meta-analysis + desc: Functions for fitting meta-analysis and other models described ion *Gould + et al. (2023)* + contents: starts_with("fit_") +- title: Extracting Analysis Outputs & Visualisation + desc: Functions for extracting model outputs, and visualising analysis results contents: - - starts_with("fit_") -- title: "Extracting Analysis Outputs & Visualisation" - desc: "Functions for extracting model outputs, and visualising analysis results" - contents: - - gg_forest - - starts_with("plot_") - - i2_ml - - calc_I2_ml - - apportion_heterogeneity_ml - - compare_ml_MA - - get_MA_fit_stats - - run_model_checks -- title: "Scaling Up: Working with data subsets or multiple datasets" - desc: > + - gg_forest + - starts_with("plot_") + - i2_ml + - calc_I2_ml + - apportion_heterogeneity_ml + - compare_ml_MA + - get_MA_fit_stats + - run_model_checks +- title: 'Scaling Up: Working with data subsets or multiple datasets' + desc: | Functions for working with multiple datasets or data subsets within a tidyverse list-column framework. -- subtitle: "Wrapper Functions" - desc: "" +- subtitle: Wrapper Functions + desc: '' contents: - - compute_metaanalysis_inputs - - meta_analyse_datasets - - make_viz -- subtitle: "Generate data subsets of full ManyEcoEvo or ManyAnalyst dataset" - desc: "" + - compute_metaanalysis_inputs + - meta_analyse_datasets + - make_viz +- subtitle: Generate data subsets of full ManyEcoEvo or ManyAnalyst dataset + desc: '' + contents: starts_with("generate_") +- title: Utility Functions + desc: Miscelaneous utility functions contents: - - starts_with("generate_") -- title: "Utility Functions" - desc: "Miscelaneous utility functions" - contents: - - capwords - - hex_key - - named_group_split + - capwords + - hex_key + - named_group_split +