diff --git a/.github/workflows/generate-docs.yml b/.github/workflows/generate-docs.yml new file mode 100644 index 0000000..0f42703 --- /dev/null +++ b/.github/workflows/generate-docs.yml @@ -0,0 +1,23 @@ +name: Generate Docs + +on: + push: + branches: + - release/1.7.0 + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + generate: + name: Docs + uses: zigurous/docs/.github/workflows/unity-package.yml@main + with: + package_title: "Animation Library" + package_base_path: com.zigurous.animation@1.7.0 + package_workflow: generate-docs.yml + package_artifact: docs + secrets: + token: ${{ secrets.DOCS_TOKEN }} diff --git a/.github/workflows/generate_docs.yml b/.github/workflows/generate_docs.yml deleted file mode 100644 index 9c5dd7b..0000000 --- a/.github/workflows/generate_docs.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Generate Docs - -on: - push: - branches: - - main - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -env: - BASE_PATH: com.zigurous.animation - PACKAGE_TITLE: "Animation Library" - -jobs: - build: - name: Build - runs-on: windows-latest - steps: - - name: Checkout package - uses: actions/checkout@v3 - with: - token: ${{ secrets.DOCS_TOKEN }} - - - name: Checkout docs template - uses: actions/checkout@v3 - with: - repository: zigurous/docs-template - ref: unity-package - token: ${{ secrets.DOCS_TOKEN }} - path: docs~ - - - name: Setup dotnet - uses: actions/setup-dotnet@v1 - with: - dotnet-version: 3.1.x - - - name: Setup docfx - uses: crazy-max/ghaction-chocolatey@v1 - with: - args: install docfx - - - name: Setup node - uses: actions/setup-node@v3 - with: - node-version: 14 - cache: yarn - cache-dependency-path: docs~/yarn.lock - - - name: Install dependencies - working-directory: docs~ - run: yarn install - env: - NPM_TOKEN: ${{ secrets.DOCS_TOKEN }} - - - name: Generate documentation - working-directory: docs~ - run: yarn generate $env:BASE_PATH $env:PACKAGE_TITLE - env: - NPM_TOKEN: ${{ secrets.DOCS_TOKEN }} - - - name: Build docs - working-directory: docs~ - continue-on-error: false - run: yarn build - env: - NPM_TOKEN: ${{ secrets.DOCS_TOKEN }} - - - name: Upload artifact - uses: actions/upload-artifact@v3 - with: - name: docs - path: docs~/public - - publish: - name: Publish - needs: build - runs-on: windows-latest - steps: - - name: Dispatch workflow - uses: actions/github-script@v6 - with: - github-token: ${{ secrets.DOCS_TOKEN }} - script: | - await github.rest.actions.createWorkflowDispatch({ - owner: 'zigurous', - repo: 'docs', - ref: 'main', - workflow_id: 'publish_artifact.yml', - inputs: { - destination_path: process.env.BASE_PATH, - artifact_repo: process.env.GITHUB_REPOSITORY, - artifact_commit: process.env.GITHUB_SHA, - artifact_workflow: 'generate_docs.yml', - artifact_name: 'docs' - } - })