Updated workflow
This commit is contained in:
parent
9bb23453be
commit
ea40b1a2ad
|
@ -13,30 +13,41 @@ jobs:
|
||||||
name: 'Merge all sample.json files to samples.json'
|
name: 'Merge all sample.json files to samples.json'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Join samples
|
- name: Checkout main branch
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
with:
|
with:
|
||||||
path: './'
|
ref: main
|
||||||
- run: |
|
path: main
|
||||||
jq -s '[.[][]]' samples/**/assets/sample.json > samples.json
|
- name: Checkout gh-pages branch
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: gh-pages
|
||||||
|
path: gh-pages
|
||||||
|
- name: Join samples
|
||||||
|
run: |
|
||||||
|
jq -s '[.[][]]' ./main/samples/**/assets/sample.json > ./main/samples.json
|
||||||
- name: Validate JSON
|
- name: Validate JSON
|
||||||
uses: docker://orrosenblatt/validate-json-action:latest
|
uses: docker://orrosenblatt/validate-json-action:latest
|
||||||
env:
|
env:
|
||||||
INPUT_SCHEMA: /metadata-schema.json
|
INPUT_SCHEMA: ./main/metadata-schema.json
|
||||||
INPUT_JSONS: /samples.json
|
INPUT_JSONS: ./main/samples.json
|
||||||
- name: Commit updated file
|
- name: copy file
|
||||||
|
uses: canastro/copy-file-action@master
|
||||||
|
with:
|
||||||
|
source: "./main/samples.json"
|
||||||
|
target: "./gh-pages/samples.json"
|
||||||
|
- name: Commit updated samples.json
|
||||||
uses: EndBug/add-and-commit@v6
|
uses: EndBug/add-and-commit@v6
|
||||||
with:
|
with:
|
||||||
message: 'Updated samples.json'
|
message: 'Updated samples.json'
|
||||||
add: 'samples.json --force'
|
add: 'samples.json --force'
|
||||||
cwd: './'
|
cwd: './main'
|
||||||
token: ${{ secrets.TOKEN }}
|
token: ${{ secrets.TOKEN }}
|
||||||
- uses: actions/checkout@v2
|
- name: Commit samples.json to gh-pages
|
||||||
|
uses: EndBug/add-and-commit@v6
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
cwd: ./gh-pages
|
||||||
- name: Copy to the pages
|
branch: gh-pages
|
||||||
uses: planetoftheweb/copy-to-branches@v1
|
add: 'samples.json --force'
|
||||||
env:
|
push: true
|
||||||
key: main
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
branches: gh-pages
|
|
||||||
files: samples.json
|
|
||||||
|
|
Loading…
Reference in New Issue