fix(deps): update dependency @sapphire/utilities to ^3.18.0 (#425) #283
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Documentation | |
on: | |
push: | |
branches: | |
- main | |
tags: | |
- 'v*' | |
jobs: | |
build: | |
name: Build Documentation | |
runs-on: ubuntu-latest | |
if: github.repository_owner == 'josh-development' | |
outputs: | |
NAME: ${{ steps.env.outputs.NAME }} | |
TYPE: ${{ steps.env.outputs.TYPE }} | |
SHA: ${{ steps.env.outputs.SHA }} | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Setup Node | |
uses: josh-development/.github/setup-node@main | |
- name: Build Documentation | |
run: yarn docs | |
- name: Upload Documentation Artifacts | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4 | |
with: | |
name: docs | |
path: docs/api.json | |
- name: Set Output | |
id: env | |
run: | | |
echo "::set-output name=NAME::${GITHUB_REF_NAME}" | |
echo "::set-output name=TYPE::${GITHUB_REF_TYPE}" | |
echo "::set-output name=SHA::${GITHUB_SHA}" | |
upload: | |
name: Upload Documentation | |
needs: build | |
runs-on: ubuntu-latest | |
env: | |
NAME: ${{ needs.build.outputs.NAME }} | |
TYPE: ${{ needs.build.outputs.TYPE }} | |
SHA: ${{ needs.build.outputs.SHA }} | |
steps: | |
- name: Checkout Project | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
- name: Use Node.js v20 | |
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4 | |
with: | |
vnode-version: 20 | |
cache: yarn | |
registry-url: https://registry.npmjs.org/ | |
- name: Install Dependencies | |
run: yarn --immutable | |
- name: Download Documentation Artifacts | |
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4 | |
with: | |
name: docs | |
path: docs | |
- name: Checkout Documentation Project | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 | |
with: | |
repository: 'josh-development/docs' | |
token: ${{ secrets.ACCESS_TOKEN }} | |
path: 'out' | |
- name: Move Documentation | |
if: ${{ env.TYPE == 'tag' }} | |
env: | |
SEMVER: ${{ env.NAME }} | |
run: | | |
mkdir -p out/docs/core | |
mv docs/api.json out/docs/core/${SEMVER}.json | |
- name: Move Documentation | |
if: ${{ env.TYPE == 'branch' }} | |
run: | | |
mkdir -p out/docs/core | |
mv docs/api.json out/docs/core/${NAME}.json | |
- name: Commit & Push | |
run: | | |
cd out | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git config rebase.autostash true | |
git config pull.rebase true | |
git add . | |
git commit -m "docs(core): build for ${TYPE} ${NAME}: ${SHA}" || true | |
git pull | |
git push |