Skip to content

chore(deps): update yarn to v4.5.0 (#353) #291

chore(deps): update yarn to v4.5.0 (#353)

chore(deps): update yarn to v4.5.0 (#353) #291

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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Node & Install Dependencies
uses: josh-development/.github/setup-node@main
with:
turbo: true
- name: Build Packages
run: yarn build
- name: Build Documentation
run: yarn docs
- name: Upload Documentation Artifacts
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # 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
runs-on: ubuntu-latest
needs: [build]
strategy:
fail-fast: false
max-parallel: 1
matrix:
package:
- auto-ensure
- cache
- schema
- transform
env:
NAME: ${{ needs.build.outputs.NAME }}
TYPE: ${{ needs.build.outputs.TYPE }}
SHA: ${{ needs.build.outputs.SHA }}
steps:
- name: Checkout Project
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Setup Node & Install Dependencies
uses: josh-development/.github/setup-node@main
with:
turbo: true
- name: Download Documentation Artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
with:
name: docs
path: docs
- name: Checkout Documentation Project
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # 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/docs/middlewares/${PACKAGE}
mv docs/${PACKAGE}/docs/api.json out/docs/middlewares/${PACKAGE}/${SEMVER}.json
- name: Move Documentation
if: ${{ env.TYPE == 'branch' }}
env:
PACKAGE: ${{ matrix.package }}
run: |
mkdir -p out/docs/middlewares/${PACKAGE}
mv docs/${PACKAGE}/docs/api.json out/docs/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