Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement automatically pushing docs to gh-pages. #80

Merged
merged 1 commit into from
Nov 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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