Skip to content

pipeline

pipeline #229

Workflow file for this run

name: pipeline
'on':
schedule:
# * is a special character in YAML so you have to quote this string
# https://crontab.guru/#15_7_*_*_1-5
- cron: '15 7 * * 1-5'
workflow_dispatch: {}
jobs:
run-pipeline:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
outputs:
changes: ${{ steps.updated.outputs.changes }}
steps:
- name: Check-out repo
uses: actions/checkout@v4
- name: 'Install R'
uses: r-lib/actions/setup-r@v2
with:
r-version: renv
use-public-rspm: true
- name: Install system dependencies
run: sudo apt-get install --yes libgdal-dev libgeos-dev libproj-dev libudunits2-dev
- name: Setup {renv}
uses: r-lib/actions/setup-renv@v2
# with:
# profile: pipeline
- name: Setup {pandoc}
uses: r-lib/actions/setup-pandoc@v2
- name: Install dvc
run: pip install dvc
- name: Generate data
run: dvc repro
- name: Set current date
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Check for updates
id: updated
run: echo "changes=$(git status --short data/ | wc -l)" >> $GITHUB_OUTPUT
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Update ONS datasets ${{ env.NOW }}
# file_pattern: data-raw data
# - if: Commit and publish changes output has committed
# Call the deploy workflow
# removing this as we're going to try getting deploy.yaml to call from this one instead
# deploy-app:
# needs: run-pipeline
# if: needs.run-pipeline.outputs.changes > 0
# uses: ./.github/workflows/deploy.yaml
# secrets: inherit