Skip to content

chore(deps): update all non-major dev-dependencies (#253) #196

chore(deps): update all non-major dev-dependencies (#253)

chore(deps): update all non-major dev-dependencies (#253) #196

Workflow file for this run

name: Documentation
on:
push:
branches:
- main
tags:
- '**'
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Use Node.js v16
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: 16
cache: yarn
registry-url: https://registry.yarnpkg.com/
- name: Install Dependencies
run: yarn --immutable
- name: Build Packages
run: yarn build
- name: Build Documentation
run: yarn docs
- name: Upload Documentation Artifacts
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4
with:
name: docs
path: packages/*/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
strategy:
fail-fast: false
matrix:
package:
- auto-ensure
- schema
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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Use Node.js v16
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4
with:
node-version: 16
cache: yarn
registry-url: https://registry.yarnpkg.com/
- name: Install Dependencies
run: yarn --immutable
- name: Download Documentation Artifacts
uses: actions/download-artifact@7a1cd3216ca9260cd8022db641d960b1db4d1be4 # v4
with:
name: docs
path: docs
- name: Checkout Documentation Project
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
repository: 'josh-development/docs'
token: ${{ secrets.ACCESS_TOKEN }}
path: 'out'
- name: Extract Package and Semver
if: ${{ env.TYPE == 'tag' }}
id: extract-tag
uses: ./scripts/formatTag
with:
tag: ${{ env.NAME }}
- name: Move Documentation
if: ${{ env.TYPE == 'tag' }}
env:
PACKAGE: ${{ steps.extract-tag.outputs.package }}
SEMVER: ${{ steps.extract-tag.outputs.semver }}
run: |
mkdir -p out/middlewares/${PACKAGE}
mv docs/${PACKAGE}/docs/api.json out/middlewares/${PACKAGE}/${SEMVER}.json
- name: Move Documentation
if: ${{ env.TYPE == 'branch' }}
env:
PACKAGE: ${{ matrix.package }}
run: |
mkdir -p out/middlewares/${PACKAGE}
mv docs/${PACKAGE}/docs/api.json out/middlewares/${PACKAGE}/${NAME}.json
- name: Commit & Push
env:
PACKAGE: ${{ matrix.package }}
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(${PACKAGE}): build for ${TYPE} ${NAME}: ${SHA}" || true
git pull
git push