docs: Add RapidAPI guide #6411
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: Test | |
on: | |
push: | |
branches: [ master, renovate/** ] | |
pull_request: | |
jobs: | |
build: | |
name: Docs build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source code | |
uses: actions/checkout@v5 | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v6 | |
with: | |
node-version: 22 | |
cache: 'npm' | |
cache-dependency-path: 'package-lock.json' | |
always-auth: 'true' | |
- name: Enable corepack | |
run: | | |
corepack enable | |
- name: Install Dependencies | |
run: npm ci --force | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: npm run build | |
env: | |
INTERCOM_APP_ID: ${{ secrets.INTERCOM_APP_ID }} | |
SEGMENT_TOKEN: ${{ secrets.SEGMENT_TOKEN }} | |
# - name: Install Nginx | |
# run: | | |
# sudo apt-get update | |
# sudo apt-get install -y nginx | |
# | |
# - name: Start Docusaurus server | |
# run: | | |
# nohup npx docusaurus serve --port 3000 --no-open & | |
# sleep 5 | |
# curl -f http://localhost:3000 > /dev/null | |
# | |
# - name: Start Nginx with project config | |
# run: | | |
# cat > default.conf <<EOF | |
# worker_processes auto; | |
# error_log $(pwd)/logs/error.log; | |
# pid $(pwd)/logs/nginx.pid; | |
# events {} | |
# http { | |
# access_log $(pwd)/logs/access.log; | |
# include $(pwd)/nginx.conf; | |
# } | |
# EOF | |
# sed -i 's|https://apify.github.io/apify-docs|http://localhost:3000|g' default.conf | |
# mkdir -p $(pwd)/logs | |
# nginx -c $(pwd)/default.conf | |
# sleep 1 | |
# | |
# - name: Run header assertions | |
# run: | | |
# set -euo pipefail | |
# function assert_header() { | |
# url=$1 | |
# header=$2 | |
# expected=$3 | |
# shift 3 | |
# extra_args=("$@") | |
# actual=$(curl -s -D - -o /dev/null "${extra_args[@]}" "$url" | grep -i "^$header" | tr -d '\r' || true) | |
# echo "→ $url → $actual" | |
# echo "$actual" | grep -q "$expected" || (echo "❌ Expected '$expected' in '$header' for $url" && exit 1) | |
# } | |
# | |
# echo "🧪 Checking Nginx responses..." | |
# | |
# assert_header "http://localhost:8080/" "Content-Type" "text/html" | |
# assert_header "http://localhost:8080/" "Content-Type" "text/markdown" -H "Accept: text/markdown" | |
# assert_header "http://localhost:8080/platform/proxy/usage" "Content-Type" "text/html" | |
# assert_header "http://localhost:8080/platform/proxy/usage.md" "Content-Type" "text/markdown" | |
# assert_header "http://localhost:8080/platform/proxy/usage" "Content-Type" "text/markdown" -H "Accept: text/markdown" | |
# assert_header "http://localhost:8080/img/docs-og.png" "Content-Type" "image/png" | |
# assert_header "http://localhost:8080/img/javascript-40x40.svg" "Content-Type" "image/svg" | |
# assert_header "http://localhost:8080/llms.txt" "Content-Type" "text/markdown" | |
# assert_header "http://localhost:8080/llms-full.txt" "Content-Type" "text/markdown" | |
# | |
# echo "✅ All Nginx header checks passed." | |
# | |
# - name: Stop Nginx | |
# if: always() | |
# run: nginx -c $(pwd)/default.conf -s stop | |
lint_content: | |
name: Lint markdown content | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source code | |
uses: actions/checkout@v5 | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v47 | |
with: | |
files: '**/*.{md,mdx}' | |
files_ignore: '!sources/api/*.{md,mdx}' | |
separator: "," | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v6 | |
with: | |
node-version: 22 | |
cache: 'npm' | |
cache-dependency-path: 'package-lock.json' | |
- name: Enable corepack | |
run: | | |
corepack enable | |
- name: Install Dependencies | |
run: npm ci --force | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: List and Lint Changed Markdown Files | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} | |
run: | | |
IFS=',' read -ra FILE_ARRAY <<< "$ALL_CHANGED_FILES" | |
for file in "${FILE_ARRAY[@]}"; do | |
npx markdownlint "$file" | |
done | |
lint_code: | |
name: Lint app code | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Source code | |
uses: actions/checkout@v5 | |
- name: Use Node.js 22 | |
uses: actions/setup-node@v6 | |
with: | |
node-version: 22 | |
cache: 'npm' | |
cache-dependency-path: 'package-lock.json' | |
- name: Enable corepack | |
run: | | |
corepack enable | |
- name: Install Dependencies | |
run: npm ci --force | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- run: npm run lint:code |