Skip to content

Commit

Permalink
Merge pull request #385 from oddbird/auto-docs
Browse files Browse the repository at this point in the history
Automatically publish documentation
  • Loading branch information
jgerigmeyer authored Nov 3, 2022
2 parents 1799090 + 82fa184 commit fd1588e
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 2 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Publish documentation
on:
release: # Run when stable releases are published
types: [released]
workflow_dispatch: # Run on-demand
inputs:
ref:
description: Git ref to build docs from
required: true
default: main
type: string

jobs:
push-branch:
name: Build & push docs
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- name: Check out from release
if: github.event_name == 'release'
uses: actions/checkout@v3
- name: Check out from manual input
if: github.event_name == 'workflow_dispatch'
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- run: yarn install
- run: yarn build
- name: Clone docs branch
uses: actions/checkout@v3
with:
path: docs-branch
ref: oddleventy-docs
- name: Commit & push to docs branch
run: |
SHA=$(git rev-parse HEAD)
cd docs-branch
rm -rf herman/docs
cp -r ${{ github.workspace }}/docs herman/
git config user.name github-actions
git config user.email [email protected]
git add -A
git commit --allow-empty \
-m "Update from https://github.com/${{ github.repository }}/commit/$SHA" \
-m "Full log: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
git push origin oddleventy-docs
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- 🐛 BUGFIX: Switch from [tinycolor](https://github.com/bgrins/TinyColor) to
[colorjs.io](https://github.com/LeaVerou/color.js) for color conversions, to
fix bug displaying colors that use hue angle notation.
- 🏠 INTERNAL: Remove documentation from npm package
- 🏠 INTERNAL: Upgrade dependencies
- 🏠 INTERNAL: Replace CircleCI, Codecov, and AppVeyor with GitHub Actions

Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
// https://jestjs.io/docs/configuration

'use strict';

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
],
"files": [
"index.js",
"docs/",
"dist/",
"!dist/webpack/app_styles.min.js",
"!dist/webpack/iframe_styles.min.js",
Expand Down

0 comments on commit fd1588e

Please sign in to comment.