diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml new file mode 100644 index 00000000..d6ce2f3c --- /dev/null +++ b/.github/workflows/publish-docs.yml @@ -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: + node-version-file: .nvmrc + 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 accoutrement/docs + mkdir -p accoutrement/docs + cp -r ${{ github.workspace }}/docs/ accoutrement/ + 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 887e6e43..3210fdb8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Accoutrement Changelog +## UNRELEASED + +- 🏠 INTERNAL: Remove documentation from npm package + ## 4.0.3 - 07/20/22 - BUGFIX: Fixed a bug with diff --git a/package.json b/package.json index ae8d2ac6..bbc1f1ff 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "files": [ "sass/**/*", "_index.scss", - "docs/", "CHANGELOG.md", "LICENSE", "README.md"