Back to original version

This commit is contained in:
Hugo Bernier 2024-03-24 21:21:17 -04:00 committed by GitHub
parent 682ad30b9b
commit 7e7b11ecfe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 48 additions and 58 deletions

View File

@ -1,4 +1,4 @@
name: Merge Sample JSON files name: Merge sample metadata
on: on:
schedule: schedule:
@ -12,68 +12,58 @@ on:
- 'samples/**/assets/sample.json' - 'samples/**/assets/sample.json'
jobs: jobs:
merge: build:
name: 'Merge all sample.json files to samples.json'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout main branch
uses: actions/checkout@v4 uses: actions/checkout@v4
with:
ref: main
path: main
- name: Checkout gh-pages branch
uses: actions/checkout@v4
with:
ref: gh-pages
path: gh-pages
- name: Checkout Docs branch
uses: actions/checkout@v4
with:
ref: Docs
path: Docs
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v2 uses: actions/setup-node@v2
with: with:
node-version: '20' node-version: '20'
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: 'main'
path: 'main'
- name: Download samples.json
run: wget https://raw.githubusercontent.com/pnp/sp-dev-fx-extensions/main/.metadata/samples.json
- name: Install dependencies - name: Install dependencies
run: npm install lodash run: npm install lodash
- name: Download Extension samples
run: |
curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3.raw" \
-o ./main/.metada/extension-samples.json \
https://raw.githubusercontent.com/pnp/sp-dev-fx-extensions/main/.metadata/samples.json
- name: Merge JSON files - name: Merge JSON files
run: node .github/workflows/merge.js run: node .github/workflows/merge.js
- name: Commit - name: copy file to gh-pages
uses: stefanzweifel/git-auto-commit-action@v4 uses: canastro/copy-file-action@master
with: with:
commit_message: 'Update samples.json' source: "./Docs/docs/samples.json"
file_pattern: samples.json target: "./gh-pages/samples.json"
push_options: '--force' - name: Commit samples.json to gh-pages
uses: EndBug/add-and-commit@v9
- name: Checkout Docs branch
uses: actions/checkout@v4
with: with:
ref: 'Docs' cwd: ./gh-pages
path: 'Docs' add: 'samples.json --force'
push: true
- name: Checkout gh-pages branch - name: Commit samples.json to Docs
uses: actions/checkout@v4 uses: EndBug/add-and-commit@v9
with: with:
ref: 'gh-pages' cwd: ./Docs
path: 'gh-pages' add: 'docs/samples.json --force'
push: true
- name: Copy samples.json to gh-pages branch
run: cp main/samples.json gh-pages/samples.json
- name: Copy samples.json to Docs branch
run: cp main/samples.json Docs/samples.json
- name: Commit to gh-pages branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Update samples.json'
branch: 'gh-pages'
push_options: '--force'
skip_dirty_check: true
- name: Commit to Docs branch
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Update samples.json'
branch: 'Docs'
push_options: '--force'
skip_dirty_check: true