-
Notifications
You must be signed in to change notification settings - Fork 3
63 lines (52 loc) · 1.75 KB
/
pipeline.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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