50 lines
1.4 KiB
YAML
50 lines
1.4 KiB
YAML
name: Merge Sample JSON
|
|
|
|
# on:
|
|
# push:
|
|
# branches:
|
|
# # When someone push to `main` branch
|
|
# - main
|
|
# # When someone pushes to `develop` branch
|
|
# - develop
|
|
# # When someone pushes to a branch within the `features` folder
|
|
# - 'features/**'
|
|
|
|
# Controls when the action will run. Workflow runs when manually triggered using the UI
|
|
# or API.
|
|
on:
|
|
workflow_dispatch
|
|
|
|
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
|
jobs:
|
|
build:
|
|
name: 'Merge all sample.json files to samples.json'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Join samples
|
|
uses: actions/checkout@v2
|
|
with:
|
|
path: './'
|
|
- run: |
|
|
jq -s '[.[][]]' samples/**/assets/sample.json > samples.json
|
|
- name: Validate JSON
|
|
uses: docker://orrosenblatt/validate-json-action:latest
|
|
env:
|
|
INPUT_SCHEMA: /metadata-schema.json
|
|
INPUT_JSONS: /samples.json
|
|
- name: Commit updated file
|
|
uses: EndBug/add-and-commit@v6
|
|
with:
|
|
message: 'Updated samples.json'
|
|
add: 'samples.json --force'
|
|
cwd: './'
|
|
token: ${{ secrets.TOKEN }}
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Copy to the pages
|
|
uses: planetoftheweb/copy-to-branches@v1
|
|
env:
|
|
key: main
|
|
branches: gh-pages
|
|
files: samples.json |