generated from Informatievlaanderen/OSLOthema-template
-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.56 KB
/
json-schema-generator.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
38
39
40
41
42
43
44
45
46
47
48
49
name: Generate JSON schema from TS configuration
on:
# Triggers the workflow on push or pull request events but only for the "main" branch
push:
branches: ["config"]
paths-ignore:
- "**/README.md"
# Daily run of this workflow at the end of the day
schedule:
- cron: "0 0 * * *"
jobs:
generate-configuration-schema:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
# Different Node versions. Each node version will trigger the action
node-version:
- 20.x
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# Runs a single command using the runners shell
- name: Install dependencies
run: |
npm install
- name: Generate the schema file
shell: bash
run: |
# make file runnable, might not be necessary
chmod +x "${GITHUB_WORKSPACE}/.github/scripts/run_generate_json_schema.sh"
# run script
"${GITHUB_WORKSPACE}/.github/scripts/run_generate_json_schema.sh"
- name: Commit and push changes
run: |
git config user.name github-actions
git config user.email [email protected]
git status
ls -al
ls -al ./schemas
git add .
git commit -m "generated the configuration json schema on `date +'%Y-%m-%d'`" || echo "No changes to commit"
git push