small formatting #3
Workflow file for this run
This file contains hidden or 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: 📚🚀 Build documentation on release | ||
| on: | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: {} | ||
| concurrency: | ||
| group: docs-build-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
| jobs: | ||
| build-docs: | ||
| name: Build Docs | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version-file: "package.json" | ||
| cache: pnpm | ||
| - name: Install deps | ||
| run: pnpm install --prefer-offline --frozen-lockfile | ||
| - name: Generate docs | ||
| #FIXME uncomment if working with monorepo structure | ||
| # working-directory: docs | ||
| env: | ||
| APP_ENV: production | ||
| run: pnpm run generate:docs | ||
| - name: Pack generated docs (tarball) | ||
| # FIXME adjust if working with monorepo structure | ||
| # run: | | ||
| # tar -czf docs-generated.tgz -C docs generated-docs | ||
| # ls -lh docs/docs-generated.tgz | ||
| run: | | ||
| tar -czf docs-generated.tgz generated-docs | ||
| ls -lh docs-generated.tgz | ||
| - name: Upload generated docs (tgz) | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: docs-generated-tgz | ||
| path: docs-generated.tgz | ||
| if-no-files-found: error | ||
| - name: Upload versions file | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: docs-versions | ||
| # FIXME adjust if working with monorepo structure | ||
| # path: docs/app/utils/versions.ts | ||
| path: app/utils/versions.ts | ||
| if-no-files-found: error | ||
| deploy-docs-on-release: | ||
| needs: [build-docs] | ||
| name: Deploy Docs | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Download generated docs (tgz) | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: docs-generated-tgz | ||
| path: . | ||
| - name: Unpack generated docs into docs/ | ||
| # FIXME adjust if working with monorepo structure | ||
| # run: | | ||
| # set -euxo pipefail | ||
| # tar -xzf docs-generated.tgz -C docs | ||
| # ls -laR docs/generated-docs | sed -n '1,200p' | ||
| run: | | ||
| tar -xzf docs-generated.tgz | ||
| ls -laR generated-docs | sed -n '1,200p' | ||
| - name: Download versions file | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: docs-versions | ||
| path: docs/app/utils | ||
| - uses: forge-42/fly-deploy@v1.0.0-rc.2 | ||
| id: deploy | ||
| env: | ||
| FLY_ORG: ${{ vars.FLY_ORG }} | ||
| FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | ||
| FLY_REGION: ${{ vars.FLY_REGION }} | ||
| with: | ||
| # FIXME uncomment if working with monorepo structure | ||
| # workspace_name: docs | ||
| app_name: ${{github.event.repository.name}}-${{ github.ref_name }} | ||
| use_isolated_workspace: true | ||
| env_vars: | | ||
| APP_ENV=production | ||
| GITHUB_OWNER=${{ github.repository_owner }} | ||
| GITHUB_REPO=${{ github.event.repository.name }} | ||
| GITHUB_REPO_URL=https://github.com/${{ github.repository }} | ||