Skip to content
Merged
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_release_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,10 @@ env:
PYTHON_VERSION: 3.14

jobs:
release_docs:
name: Release docs
environment:
name: github-pages
build_docs:
name: Build docs
permissions:
contents: write
pages: write
id-token: write
contents: read
checks: read
runs-on: ubuntu-latest

Expand All @@ -52,7 +48,7 @@ jobs:
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.ref }}
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
persist-credentials: false

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
Expand Down Expand Up @@ -83,14 +79,26 @@ jobs:
APIFY_SIGNING_TOKEN: ${{ secrets.APIFY_SIGNING_TOKEN }}
SEGMENT_TOKEN: ${{ secrets.SEGMENT_TOKEN }}

- name: Set up GitHub Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0

- name: Upload GitHub Pages artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: ./website/build

# The service account token is only used in a job that does not run the docs toolchain.
deploy_docs:
name: Deploy docs
needs: [build_docs]
environment:
name: github-pages
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest

steps:
- name: Set up GitHub Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0

- name: Deploy artifact to GitHub Pages
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1

Expand Down
54 changes: 51 additions & 3 deletions .github/workflows/manual_version_docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ jobs:
name: Version docs
runs-on: ubuntu-latest
permissions:
contents: write
contents: read
checks: read
outputs:
sha: ${{ steps.sha.outputs.sha }}
version: ${{ steps.snapshot.outputs.version }}

steps:
# Gate manual dispatches on the `Checks` workflow already succeeding on this commit (run by `on_master.yaml`);
Expand All @@ -51,7 +54,11 @@ jobs:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
persist-credentials: false

- name: Record the built commit
id: sha
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"

- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
Expand Down Expand Up @@ -122,10 +129,51 @@ jobs:
uv run pnpm exec docusaurus docs:version "$MAJOR_MINOR_VERSION"
uv run pnpm exec docusaurus api:version "$MAJOR_MINOR_VERSION"

- name: Upload versioned docs
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: versioned-docs
path: |
website/versioned_docs
website/versioned_sidebars
website/versions.json
include-hidden-files: true
retention-days: 1

# The service account token is only used in a job that does not run the docs toolchain.
commit_versioned_docs:
name: Commit versioned docs
needs: [version_docs]
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

# Start from the commit the snapshot was made on, so the pull below merges it with anything pushed since.
- name: Reset to the built commit
run: git reset --hard "$BUILT_SHA"
env:
BUILT_SHA: ${{ needs.version_docs.outputs.sha }}

- name: Remove the previous snapshot
run: rm -rf website/versioned_docs website/versioned_sidebars website/versions.json

- name: Download versioned docs
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
with:
name: versioned-docs
path: website

- name: Commit and push versioned docs
uses: apify/actions/signed-commit@v1.6.2
with:
message: "docs: Version docs for v${{ steps.snapshot.outputs.version }} [skip ci]"
message: "docs: Version docs for v${{ needs.version_docs.outputs.version }} [skip ci]"
add: website/versioned_docs website/versioned_sidebars website/versions.json
pull: --rebase --autostash
github-token: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"lint:code:fix": "oxlint --type-aware --fix",
"format": "oxfmt",
"format:check": "oxfmt --check",
"opt:images": "pnx --config.onlyBuiltDependencies=* @343dev/optimizt --webp",
"preinstall": "npx only-allow pnpm"
"opt:images": "pnx --config.onlyBuiltDependencies=* @343dev/optimizt --webp"
},
"dependencies": {
"@apify/docusaurus-plugin-typedoc-api": "^5.1.16",
Expand Down
Loading