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
32 changes: 32 additions & 0 deletions .github/workflows/pr-previews.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docs PR Previews

on:
pull_request:
types: [opened, synchronize, reopened, closed]

concurrency:
cancel-in-progress: false
group: 'docs-pr-previews-${{ github.event.pull_request.number }}'

jobs:
trigger-preview:
if: github.event.action != 'closed'

runs-on: ubuntu-latest

steps:
- name: Trigger preview
run: gh workflow run apify_docs_pr.yml --repo apify/apify-docs-private --field pr-number=${{ github.event.pull_request.number }} --field original-repository=${{ github.repository }}
env:
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}

delete-preview:
if: github.event.action == 'closed'

runs-on: ubuntu-latest

steps:
- name: Delete preview
run: gh workflow run apify_docs_pr.yml --repo apify/apify-docs-private --field pr-number=${{ github.event.pull_request.number }} --field original-repository=${{ github.repository }} --field action=delete
env:
GH_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
24 changes: 15 additions & 9 deletions apify-docs-theme/src/config.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
/* eslint-disable global-require */
// eslint-disable-next-line no-nested-ternary
const absoluteUrl = process.env.LOCALHOST
? 'http://localhost:3000'
: process.env.DEV
? 'http://docs.apify.loc'
: 'https://docs.apify.com';

const themeConfig = ({
let absoluteUrl = 'https://docs.apify.com';

if (process.env.LOCALHOST) {
absoluteUrl = 'http://localhost:3000';
} else if (process.env.DEV) {
absoluteUrl = 'http://docs.apify.loc';
} else if (process.env.APIFY_DOCS_ABSOLUTE_URL) {
absoluteUrl = process.env.APIFY_DOCS_ABSOLUTE_URL;
}

const themeConfig = {
docs: {
versionPersistence: 'localStorage',
sidebar: {
Expand Down Expand Up @@ -277,7 +281,7 @@ const themeConfig = ({
async: true,
defer: true,
},
});
};

const plugins = [
[
Expand All @@ -294,7 +298,9 @@ const plugins = [
return {
resolveLoader: {
alias: {
'roa-loader': require.resolve(`${__dirname}/roa-loader/`),
'roa-loader': require.resolve(
`${__dirname}/roa-loader/`,
),
},
},
};
Expand Down
2 changes: 1 addition & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ module.exports = {
module: {
rules: [
{
test: /apify-docs\/examples\//i,
test: /examples\//i,
type: 'asset/source',
},
],
Expand Down
2 changes: 1 addition & 1 deletion examples/ts-parallel-scraping/orchestrator/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if (state.isInitialized) {
state.isInitialized = true;
}

const parallelRunPromises = state.parallelRunIds.map((runId) => {
const parallelRunPromises = state.parallelRunIds.map(async (runId) => {
const runClient = apifyClient.run(runId);
return runClient.waitForFinish();
});
Expand Down