Skip to content

Commit

Permalink
docs: push docs coverage changes after updating the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaStevens committed Feb 19, 2023
1 parent 08e2947 commit ffef6e6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/actions/prepare/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ runs:
cache: "pnpm"
- run: pnpm install --frozen-lockfile
shell: bash
- uses: ./.github/actions/git-config
10 changes: 10 additions & 0 deletions .github/actions/prepare/git-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Prepare
description: Configrue the git user

runs:
using: "composite"
steps:
- name: Configure Git
run: |
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name ${GITHUB_ACTOR}
20 changes: 20 additions & 0 deletions .github/workflows/release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
- name: Checkout src
uses: actions/checkout@v3

- uses: ./.github/actions/git-config

- run: mkdir -p ./gh-pages
- name: Download the existing documents artifact
uses: actions/download-artifact@v3
Expand All @@ -75,3 +77,21 @@ jobs:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

- name: Update Coverage Badge
env:
PACKAGE_VERSION: >
$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
run: cp ./gh-pages/v$PACKAGE_VERSION/coverage.svg ./docs/coverage.svg

- run: COVERAGE_CHANGED=$(git status --porcelain -u | grep -c docs/coverage.svg)
- if: $COVERAGE_CHANGED != "0"
run: >
git add docs/coverage.svg
git diff --name-only --cached --diff-filter=AM
git commit -m "docs: updated documentation coverage"
git push
2 changes: 0 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
fetch-depth: 0
- uses: ./.github/actions/prepare
- run: pnpm build
- run: git config user.name "${GITHUB_ACTOR}"
- run: git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
Expand Down

0 comments on commit ffef6e6

Please sign in to comment.