push to main #6
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: "Generate docs" | |
| on: [push] | |
| jobs: | |
| docs: | |
| name: Generate docs | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| # Setup .npmrc file to publish to npm | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version-file: ".nvmrc" | |
| cache: "yarn" | |
| cache-dependency-path: "**/yarn.lock" | |
| registry-url: "https://registry.npmjs.org" | |
| scope: "@bucketco" | |
| - name: Install dependencies | |
| run: yarn install --immutable | |
| - name: Build packages | |
| run: yarn build | |
| - name: Build docs | |
| run: yarn docs | |
| - name: Checkout docs with SSH | |
| uses: actions/checkout@v3 | |
| with: | |
| repository: bucketco/docs | |
| ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }} | |
| path: bucket-docs | |
| - name: Copy generated docs to docs repo | |
| run: | | |
| rm -rf bucket-docs/sdk-docs | |
| cp -R dist/docs bucket-docs/sdk-docs | |
| - name: Commit and push changes | |
| run: | | |
| cd bucket-docs | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@bucket.co" | |
| git add sdk-docs | |
| git commit -m "Update documentation" | |
| git push | |