mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
Updating CI to build and commit the documentation
This commit is contained in:
parent
533ef36b1b
commit
c99bc5c6e8
25
.github/workflows/ci.yml
vendored
25
.github/workflows/ci.yml
vendored
@ -213,3 +213,28 @@ jobs:
|
||||
|
||||
- name: Create Guide & Commit if there are changes
|
||||
run: npm run commit:guides
|
||||
|
||||
update_docs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test_unit, test_integration]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16'
|
||||
|
||||
- name: checkout ocean.js repo
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'oceanprotocol/ocean.js'
|
||||
path: 'ocean.js'
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
|
||||
- name: setup git config
|
||||
run: |
|
||||
# setup the username and email. I tend to use 'GitHub Actions Bot' with no email by default
|
||||
git config user.name "GitHub Actions Bot"
|
||||
git config user.email "<>"
|
||||
|
||||
- name: Create updated docs & commit changes
|
||||
run: npm run commit:docs
|
||||
|
@ -35,7 +35,8 @@
|
||||
"test:integration:cover": "nyc --report-dir coverage/integration --no-clean npm run test:integration",
|
||||
"create:guide": "./scripts/createCodeExamples.sh test/integration/CodeExamples.test.ts",
|
||||
"create:guidec2d": "./scripts/createCodeExamples.sh test/integration/ComputeExamples.test.ts",
|
||||
"commit:guides": "./scripts/commitChanges.sh"
|
||||
"commit:guides": "./scripts/commitChanges.sh",
|
||||
"commit:docs": "./scripts/updateDocs.sh"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
10
scripts/updateDocs.sh
Normal file
10
scripts/updateDocs.sh
Normal file
@ -0,0 +1,10 @@
|
||||
# Create updated documentation
|
||||
npm run docs
|
||||
|
||||
# Stage the file, commit and push
|
||||
git status
|
||||
git add ./docs
|
||||
git commit -m "Updating documentation"
|
||||
branch=${GITHUB_HEAD_REF#refs/heads/}
|
||||
echo Pushing changes to branch: ${branch}
|
||||
git push origin HEAD:${branch} --force
|
Loading…
x
Reference in New Issue
Block a user