Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 19 additions & 11 deletions .github/workflows/manual_regenerate_models.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,27 @@ jobs:
uv run poe generate-models
fi

- name: Commit and push model changes
id: commit
uses: EndBug/add-and-commit@v10
- name: Stage model changes
id: stage
run: |
git add 'src/apify_client/_*_generated.py'
if git diff --cached --quiet; then
echo "has-changes=false" >> "$GITHUB_OUTPUT"
else
echo "has-changes=true" >> "$GITHUB_OUTPUT"
fi

- name: Commit model changes
if: steps.stage.outputs.has-changes == 'true'
uses: apify/workflows/commit@v0.44.0
with:
add: 'src/apify_client/_*_generated.py'
author_name: apify-service-account
author_email: apify-service-account@users.noreply.github.com
message: ${{ env.TITLE }}
commit: --no-verify
push: -u origin ${{ env.BRANCH }}
commit-message: ${{ env.TITLE }}
github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
branch: ${{ env.BRANCH }}
create-branch: 'true'

- name: Create or update PR
if: steps.commit.outputs.committed == 'true'
if: steps.stage.outputs.has-changes == 'true'
id: pr
env:
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
Expand Down Expand Up @@ -150,7 +158,7 @@ jobs:

# Post a cross-repo comment on the original docs PR so reviewers know about the corresponding client-python PR.
- name: Comment on apify-docs PR
if: steps.commit.outputs.committed == 'true' && inputs.docs_pr_number
if: steps.stage.outputs.has-changes == 'true' && inputs.docs_pr_number
env:
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
PR_CREATED: ${{ steps.pr.outputs.created }}
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/manual_release_beta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,4 @@ jobs:
pages: write
id-token: write
uses: ./.github/workflows/manual_release_docs.yaml
with:
# Use the ref from the changelog update to include the updated changelog.
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
secrets: inherit
28 changes: 15 additions & 13 deletions .github/workflows/manual_release_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:

# Runs when invoked by another workflow.
workflow_call:
inputs:
ref:
description: Git ref to checkout.
required: true
type: string

permissions:
contents: read
Expand All @@ -35,7 +30,6 @@ jobs:
uses: actions/checkout@v6
with:
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
ref: ${{ inputs.ref || github.event.repository.default_branch }}

- name: Set up Node
uses: actions/setup-node@v6
Expand Down Expand Up @@ -63,15 +57,23 @@ jobs:
- name: Update docs theme
run: uv run poe update-docs-theme

- name: Stage updated package.json and lockfile
id: stage
run: |
git pull --rebase --autostash
git add website/package.json website/pnpm-lock.yaml
if git diff --cached --quiet; then
echo "has-changes=false" >> "$GITHUB_OUTPUT"
else
echo "has-changes=true" >> "$GITHUB_OUTPUT"
fi

- name: Commit the updated package.json and lockfile
uses: EndBug/add-and-commit@v10
if: steps.stage.outputs.has-changes == 'true'
uses: apify/workflows/commit@v0.44.0
with:
add: website/package.json website/pnpm-lock.yaml
message: "chore: Automatic docs theme update [skip ci]"
default_author: github_actions
pull: '--rebase --autostash'
# `actions/checkout` detaches HEAD on SHA refs; EndBug needs a branch to push.
new_branch: ${{ github.event.repository.default_branch }}
commit-message: "chore: Automatic docs theme update [skip ci]"
github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

- name: Build docs
run: uv run poe build-docs
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/manual_release_stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,6 @@ jobs:
permissions:
contents: write
uses: ./.github/workflows/manual_version_docs.yaml
with:
# Commit the version docs changes on top of the changelog commit.
ref: ${{ needs.changelog_update.outputs.changelog_commitish }}
secrets: inherit

doc_release:
Expand All @@ -121,7 +118,4 @@ jobs:
pages: write
id-token: write
uses: ./.github/workflows/manual_release_docs.yaml
with:
# Commit the docs release changes on top of the version docs commit.
ref: ${{ needs.version_docs.outputs.version_docs_commitish }}
secrets: inherit
42 changes: 15 additions & 27 deletions .github/workflows/manual_version_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ on:

# Runs when invoked by another workflow.
workflow_call:
inputs:
ref:
description: Git ref to checkout.
required: true
type: string
outputs:
version_docs_commitish:
description: The commit SHA of the versioned docs commit.
value: ${{ jobs.version_docs.outputs.version_docs_commitish }}

concurrency:
group: version-docs
Expand All @@ -31,8 +22,6 @@ jobs:
version_docs:
name: Version docs
runs-on: ubuntu-latest
outputs:
version_docs_commitish: ${{ steps.resolve_commitish.outputs.commitish }}
permissions:
contents: write

Expand All @@ -41,7 +30,6 @@ jobs:
uses: actions/checkout@v6
with:
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
ref: ${{ inputs.ref || github.event.repository.default_branch }}

- name: Set up Node
uses: actions/setup-node@v6
Expand Down Expand Up @@ -104,20 +92,20 @@ jobs:
uv run pnpm exec docusaurus docs:version "$MAJOR_MINOR_VERSION"
uv run pnpm exec docusaurus api:version "$MAJOR_MINOR_VERSION"

- name: Stage versioned docs
id: stage
run: |
git pull --rebase --autostash
git add website/versioned_docs website/versioned_sidebars website/versions.json
if git diff --cached --quiet; then
echo "has-changes=false" >> "$GITHUB_OUTPUT"
else
echo "has-changes=true" >> "$GITHUB_OUTPUT"
fi

- name: Commit and push versioned docs
id: commit_versioned_docs
uses: EndBug/add-and-commit@v10
if: steps.stage.outputs.has-changes == 'true'
uses: apify/workflows/commit@v0.44.0
with:
add: website/versioned_docs website/versioned_sidebars website/versions.json
message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]"
default_author: github_actions
pull: '--rebase --autostash'
# `actions/checkout` detaches HEAD on SHA refs; EndBug needs a branch to push.
new_branch: ${{ github.event.repository.default_branch }}

- name: Resolve output commitish
id: resolve_commitish
env:
COMMIT_SHA: ${{ steps.commit_versioned_docs.outputs.commit_long_sha }}
run: |
echo "commitish=${COMMIT_SHA:-$(git rev-parse HEAD)}" >> "$GITHUB_OUTPUT"
commit-message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]"
github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
3 changes: 0 additions & 3 deletions .github/workflows/on_master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ jobs:
pages: write
id-token: write
uses: ./.github/workflows/manual_release_docs.yaml
with:
# Use the same ref as the one that triggered the workflow.
ref: ${{ github.ref }}
secrets: inherit

code_checks:
Expand Down
Loading