Skip to content

Commit

Permalink
Added new pkgdown workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
telkamp7 committed Nov 8, 2023
1 parent 6150669 commit ecb4d0b
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
44 changes: 39 additions & 5 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,32 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [main, master]
branch: master
pull_request:
branches: [main, master]
branch: master
release:
types: [published]
workflow_dispatch:

name: pkgdown
name: Deploy to GitHub Pages

jobs:
pkgdown:
cleanup:
name: 🧼 Clean up environment
if: ${{ (github.repository == 'ssi-dk/aedseo') && (github.event_name == 'release') }}
runs-on: ubuntu-latest
permissions: write-all

steps:
- name: 🗑 Delete previous deployments
uses: strumwolf/delete-deployment-environment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: github-pages
onlyRemoveDeployments: true

pkgdown-build:
name: Render pkgdown output
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
Expand All @@ -39,8 +54,27 @@ jobs:
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: pkgdown
path: docs/

deploy:
name: Deploy to GitHub pages 🚀
runs-on: ubuntu-latest
if: ${{ (github.repository == 'ssi-dk/aedseo') && (github.event_name == 'release') }}
needs: [cleanup, pkgdown-build]
steps:
- uses: actions/checkout@v3

- name: Download pkgdown output
uses: actions/download-artifact@v3
with:
name: pkgdown
path: docs

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
clean: false
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ To quickly get started with `aedseo`, follow these steps:

1. Install the package using the code provided above.
2. Load the package with `library(aedseo)`.
3. Create a time series data object (`tsibble`) from your data using the `aedseo::tsd` function.
3. Create a time series data object (`aedseo_tsd`) from your data using the `aedseo::tsd` function.
4. Apply the `aedseo::aedseo` function to estimate growth rates and detect seasonal epidemic onsets.

```r
# Load the package
library(aedseo)

# Create a tsibble object from your data
# Create a aedseo_tsd object from your data
tsd_data <- tsd(
observed = c(100, 120, 150, 180, 220, 270),
time = as.Date(c(
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ To quickly get started with `aedseo`, follow these steps:

1. Install the package using the code provided above.
2. Load the package with `library(aedseo)`.
3. Create a time series data object (`tsibble`) from your data using
3. Create a time series data object (`aedseo_tsd`) from your data using
the `aedseo::tsd` function.
4. Apply the `aedseo::aedseo` function to estimate growth rates and
detect seasonal epidemic onsets.
Expand All @@ -57,7 +57,7 @@ To quickly get started with `aedseo`, follow these steps:
# Load the package
library(aedseo)

# Create a tsibble object from your data
# Create a aedseo_tsd object from your data
tsd_data <- tsd(
observed = c(100, 120, 150, 180, 220, 270),
time = as.Date(c(
Expand Down

0 comments on commit ecb4d0b

Please sign in to comment.