Skip to content

Commit

Permalink
Merge pull request #245 from oddbird/auto-docs
Browse files Browse the repository at this point in the history
Automatically publish oddleventy docs
  • Loading branch information
jgerigmeyer committed Nov 7, 2022
2 parents 2d049b3 + 2613a38 commit ab379ca
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 1 deletion.
54 changes: 54 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
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:
version: lts/*
cache: yarn
- run: yarn install
- run: yarn docs
- 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 true/docs
mkdir -p true/docs
cp -r ${{ github.workspace }}/docs/ true/
git config user.name github-actions
git config user.email github-actions@github.com
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# True Changelog

## UNRELEASED

- 🏠 INTERNAL: Remove documentation from npm package

## 7.0.0-beta.0 (09/16/22)

- BREAKING: Upgrade to newer [Sass API](https://sass-lang.com/documentation/js-api)
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"lib/**/*",
"sass/**/*",
"_index.scss",
"docs/",
"CHANGELOG.md",
"LICENSE.txt",
"README.md"
Expand Down

0 comments on commit ab379ca

Please sign in to comment.