updated from template to actual project description #47
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
name: container-workflow-template | |
on: | |
push: | |
branches: | |
- main | |
- master | |
- fix/* | |
- feature/* | |
- enhancement/* | |
pull_request: | |
branches: | |
- main | |
- master | |
workflow_dispatch: | |
branches: | |
- '*' | |
#schedule: | |
# - cron: "0 8 * * *" | |
jobs: | |
container-workflow-template: | |
runs-on: ubuntu-latest # Run on GitHub Actions runner | |
#runs-on: [self-hosted, linux, x64, onprem-aegypti] # Run the workflow on EHA aegypti runner | |
#runs-on: [self-hosted, linux, x64, onprem-prospero] # Run the workflow on EHA prospero runner | |
container: | |
image: rocker/verse:4.2.1 | |
steps: | |
# update to: git config --global --add safe.directory /__w/your-repo/your-repo | |
- name: update permissions for container based workflows | |
run: git config --global --add safe.directory /__w/container-template/container-template | |
- uses: actions/checkout@v3 | |
- name: Install system dependencies | |
run: | | |
apt-get update && apt-get install -y --no-install-recommends \ | |
libcurl4-openssl-dev \ | |
libssl-dev | |
- name: Install packages from renv.lock (with cache) | |
if: ${{ !env.ACT }} ## Doesn't work locally with ACT | |
uses: r-lib/actions/setup-renv@v2 | |
with: | |
cache-version: 3 | |
- name: Install packages from renv.lock (local, no cache) | |
if: ${{ env.ACT }} ## Only locally with ACT, use `act -r` to reuse containers, effectively caching locally | |
run: | | |
renv::restore() | |
shell: Rscript {0} | |
- name: Run targets workflow | |
run: | | |
targets::tar_make() | |
shell: Rscript {0} | |
- name: On failure, launch a temporary interactive debugging session | |
uses: mxschmitt/action-tmate@v3 | |
if: ${{ failure() }} | |
timeout-minutes: 15 | |