-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (35 loc) · 1.28 KB
/
import.yml
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
name: Import Data from Sirius
on:
schedule:
- cron: '0 7 * * 1-5'
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Pull Sirius Source data
env:
GITHUB_TOKEN: ${{ secrets.ORG_ACCESS_TOKEN }}
run: |
mkdir ./source-data
gh run download -n data-dictionary-json -R ministryofjustice/opg-sirius -D ./source-data
- name: Checkout
uses: actions/checkout@v3.2.0
with:
path: 'data-dictionary'
- name: Build
env:
GH_TOKEN: ${{ secrets.ORG_ACCESS_TOKEN }}
run: |
cd ./data-dictionary
branch=import-$(date +'%Y-%m-%d')
git branch $branch
git switch $branch
cp ../source-data/* ./src/_data/
echo "**Changed files pulled from Sirius data definitions:**" >> $GITHUB_STEP_SUMMARY
git status -s >> $GITHUB_STEP_SUMMARY
git config --global user.email "tools@digital.justice.gov.uk"
git config --global user.name "Github Action"
git add ./src/_data/
git commit -m "Import definitions from Sirius to Dictionary"
git push --set-upstream origin $branch
gh pr create --title "Data tables update" --body "Updating tables for data from Sirius tables"