generated from OxfordIHTM/ihtm-targets-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create targets releases workflow and gha automation
- Loading branch information
1 parent
769ef4a
commit 5d7e276
Showing
5 changed files
with
142 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: deploy targets releases | ||
|
||
on: | ||
schedule: | ||
- cron: "0 5 * * *" | ||
workflow_dispatch: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
deploy-targets-releases: | ||
runs-on: ubuntu-latest | ||
container: rocker/tidyverse:4.4.1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install system dependencies | ||
run: | | ||
apt-get update && apt-get install -y --no-install-recommends \ | ||
libxt6 libglpk-dev libpoppler-cpp-dev libmagick++-dev \ | ||
libtesseract-dev libleptonica-dev tesseract-ocr-eng | ||
- name: Trust git repo | ||
run: | | ||
git config --global --add safe.directory /__w/paglaom/paglaom | ||
- name: Install packages from renv.lock (with cache) | ||
if: ${{ !env.ACT }} | ||
uses: r-lib/actions/setup-renv@v2 | ||
with: | ||
cache-version: 2 | ||
|
||
- name: Install packages from renv.lock (local, no cache) | ||
if: ${{ env.ACT }} | ||
run: | | ||
renv::restore() | ||
shell: Rscript {0} | ||
|
||
- name: Run workflow | ||
run: | | ||
targets::tar_make(script = "_targets_releases.R") | ||
shell: Rscript {0} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: test targets climate | ||
|
||
on: | ||
pull_request: | ||
branches: [main, master] | ||
workflow_dispatch: | ||
branches: | ||
- '*' | ||
|
||
jobs: | ||
test-targets-climate: | ||
runs-on: ubuntu-latest | ||
container: rocker/tidyverse:4.4.1 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install system dependencies | ||
run: | | ||
apt-get update && apt-get install -y --no-install-recommends \ | ||
libxt6 libglpk-dev libpoppler-cpp-dev libmagick++-dev \ | ||
libtesseract-dev libleptonica-dev tesseract-ocr-eng | ||
- name: Install packages from renv.lock (with cache) | ||
if: ${{ !env.ACT }} | ||
uses: r-lib/actions/setup-renv@v2 | ||
with: | ||
cache-version: 2 | ||
|
||
- name: Install packages from renv.lock (local, no cache) | ||
if: ${{ env.ACT }} | ||
run: | | ||
renv::restore() | ||
shell: Rscript {0} | ||
|
||
- name: Run workflow | ||
run: | | ||
targets::tar_make(script = "_targets_climate.R") | ||
shell: Rscript {0} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,25 @@ | ||
################################################################################ | ||
# | ||
# Targets workflow for weekly data releases | ||
# | ||
################################################################################ | ||
|
||
## Setup workflow using project-wide settings ---------------------------------- | ||
source("_targets_setup.R") | ||
|
||
|
||
## Release targets ------------------------------------------------------------- | ||
|
||
release_targets <- tar_plan( | ||
### Create weekly GitHub release ---- | ||
tar_target( | ||
name = paglaom_weekly_release_tag, | ||
command = paglaom_create_weekly_release(major = 1), | ||
cue = tar_cue("always") | ||
), | ||
### Upload weekly data release ---- | ||
tar_target( | ||
name = paglaom_weekly_release, | ||
command = paglaom_upload_weekly_release(tag = paglaom_weekly_release_tag) | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters