docs(dockerfile): warn about the npm omit=dev + tsc build trap in Typ… #498
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: publish-theme | |
| on: | |
| push: | |
| branches: | |
| - master | |
| workflow_dispatch: | |
| concurrency: | |
| group: publish-theme | |
| cancel-in-progress: false | |
| permissions: | |
| id-token: write | |
| contents: write | |
| jobs: | |
| look_for_change: | |
| if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }} | |
| runs-on: ubuntu-latest | |
| outputs: | |
| theme_changed: ${{ steps.changed-theme-files.outputs.any_changed }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Use Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| - name: Check changes in theme | |
| id: changed-theme-files | |
| uses: tj-actions/changed-files@v47 | |
| with: | |
| since_last_remote_commit: "true" | |
| files: | | |
| apify-docs-theme/** | |
| publish: | |
| needs: look_for_change | |
| if: ${{ needs.look_for_change.outputs.theme_changed == 'true' || github.event_name == 'workflow_dispatch' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
| - name: Use Node.js | |
| uses: actions/setup-node@v7 | |
| with: | |
| node-version: 24 | |
| registry-url: 'https://registry.npmjs.org' | |
| - uses: apify/actions/pnpm-install@v1.3.1 | |
| - name: Setup git user and npm | |
| run: | | |
| git config --global user.name "Apify Release Bot" | |
| git config --global user.email "noreply@apify.com" | |
| - name: Bump the theme version | |
| run: | | |
| cd "$GITHUB_WORKSPACE/apify-docs-theme" | |
| PACKAGE_NAME=$(jq -r .name package.json) | |
| LATEST_VERSION=$(pnpm show "$PACKAGE_NAME" version 2>/dev/null || jq -r .version package.json) | |
| # Compute the next patch version from the latest published one and write it directly. | |
| # Avoid `pnpm version patch`, which refuses to run when the working tree is dirty | |
| # (it becomes dirty whenever the committed version has drifted behind npm). | |
| NEXT_VERSION=$(npx --yes semver -i patch "$LATEST_VERSION") | |
| pnpm pkg set "version=$NEXT_VERSION" | |
| - name: Deploy theme to npm | |
| run: | | |
| cd "$GITHUB_WORKSPACE/apify-docs-theme" | |
| pnpm publish --no-git-checks | |
| - name: Wait until the new theme version is available on npm | |
| run: | | |
| cd "$GITHUB_WORKSPACE/apify-docs-theme" | |
| PACKAGE_NAME=$(jq -r .name package.json); | |
| PACKAGE_VER=$(jq -r .version package.json); | |
| for _ in $(seq 1 10); do | |
| EXIT_CODE=0; | |
| pnpm show "$PACKAGE_NAME@$PACKAGE_VER" || EXIT_CODE=1; | |
| if [[ $EXIT_CODE -eq 1 ]]; then | |
| echo "The new package version ($PACKAGE_VER) is not yet available, waiting 30 seconds..."; | |
| sleep 30; | |
| continue; | |
| fi; | |
| echo "The new package version ($PACKAGE_VER) is live, proceeding!"; | |
| break; | |
| done; | |
| pnpm show "$PACKAGE_NAME@$PACKAGE_VER" # fails if the package is not available, succeeds if it is | |
| - name: Commit the new theme version | |
| uses: apify/actions/signed-commit@v1.0.0 | |
| with: | |
| message: 'chore: publish new version of @apify/docs-theme [skip ci]' | |
| add: 'apify-docs-theme/package.json' | |
| pull: '--rebase --autostash' | |
| github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
| rebuild-docs: | |
| needs: publish | |
| strategy: | |
| matrix: | |
| repo: | |
| - apify/apify-sdk-js | |
| - apify/apify-cli | |
| - apify/apify-client-js | |
| runs-on: ubuntu-latest | |
| steps: | |
| - env: | |
| GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
| run: | | |
| gh workflow run docs.yaml --repo ${{ matrix.repo }} | |
| rebuild-python-docs: | |
| needs: publish | |
| strategy: | |
| matrix: | |
| repo: | |
| - apify/apify-sdk-python | |
| - apify/apify-client-python | |
| runs-on: ubuntu-latest | |
| steps: | |
| - env: | |
| GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }} | |
| run: | | |
| gh workflow run manual_release_docs.yaml --repo ${{ matrix.repo }} |