Skip to content

Commit

Permalink
Merge pull request #80 from strazzere/automate_docs
Browse files Browse the repository at this point in the history
Implement automatically pushing docs to gh-pages.
  • Loading branch information
NeoTheThird authored Nov 27, 2022
2 parents 7d96288 + 72ad34b commit aea22f5
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,46 @@ jobs:
with:
file: coverage/lcov.info
verbose: true

github-pages:
name: Publish Docs
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Use Node.js 16
uses: actions/setup-node@v1
with:
node-version: "16"
- name: Build docs
run: |
npm ci
npm run docs
cd docs/promise-android-tools/$(node -p "require('./package.json').version")
tar czf ../../../pages.tgz .
- name: Upload docs
uses: actions/upload-artifact@v3
with:
name: pages
path: pages.tgz
retention-days: 1

- name: Change to pages branch
uses: actions/checkout@v3
with:
ref: gh-pages

- name: Download docs
uses: actions/download-artifact@v3
with:
name: pages

- name: Add new docs
run: |
tar xzf pages.tgz
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
git add $(tar tzf pages.tgz)
git commit -m 'New doc pages from GitHub Workflow'
git push origin gh-pages

0 comments on commit aea22f5

Please sign in to comment.