sp-dev-fx-webparts/.github/workflows/merge-sample-json.yml

42 lines
1.1 KiB
YAML
Raw Normal View History

2022-02-12 15:48:05 -05:00
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:
2022-02-12 19:02:52 -05:00
build:
2022-02-12 19:42:39 -05:00
name: 'Merge all sample.json files to samples.json'
2022-02-12 19:02:52 -05:00
runs-on: ubuntu-latest
2022-02-12 15:48:05 -05:00
steps:
2022-02-12 19:42:39 -05:00
- name: Join samples
uses: actions/checkout@v2
2022-02-12 19:02:52 -05:00
with:
path: './'
- run: |
2022-02-12 19:11:58 -05:00
jq -s '[.[][]]' samples/**/assets/sample.json > samples.json
2022-02-12 19:02:52 -05:00
2022-02-12 19:42:39 -05:00
- name: Commit updated file
uses: EndBug/add-and-commit@v6
2022-02-12 19:02:52 -05:00
with:
2022-02-12 19:11:58 -05:00
message: 'Updated samples.json'
add: 'samples.json --force'
2022-02-12 19:02:52 -05:00
cwd: './'
2022-02-12 19:42:39 -05:00
token: ${{ secrets.TOKEN }}
- name: Copy to the pages
uses: planetoftheweb/copy-to-branches@v1
env:
branches: gh-pages
files: samples.json