Skip to content

archive website data #46

archive website data

archive website data #46

name: archive website data
on:
schedule:
- cron: "0 17 * * *"
workflow_dispatch:
jobs:
archive-website-data:
runs-on: ubuntu-latest
container: rocker/tidyverse:4.4.1
env:
GIT_CRYPT_KEY64: ${{ secrets.GIT_CRYPT_KEY64 }}
FIGSHARE_TOKEN: ${{ secrets.FIGSHARE_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: |
apt-get update && apt-get install -y --no-install-recommends \
libxt6 libglpk-dev
- name: Trust git repo
run: |
git config --global --add safe.directory /__w/pandemic-pact-research/pandemic-pact-research
- 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(pact_data_archive)
shell: Rscript {0}
- name: Commit and push files
run: |
git config --global user.email "[email protected]"
git config --global user.name "ernestguevarra"
git add .
git diff-index --quiet HEAD || git commit -m "archive daily Pandemic PACT data"
git push