1
0
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:
Jamie Hewitt 2023-05-02 17:56:25 +01:00
parent 533ef36b1b
commit c99bc5c6e8
3 changed files with 37 additions and 1 deletions

View File

@ -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

View File

@ -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
View 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