diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..8e1123d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,28 @@ +name: CI + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout the repo + uses: actions/checkout@v6 + + - name: Install Bun + uses: oven-sh/setup-bun@v2 + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Apply patches + run: npx patch-package + + - name: Build + run: bun run build + + - name: Download content + run: bun run download-content diff --git a/scripts/download-content.ts b/scripts/download-content.ts index d142da9..a259fcf 100644 --- a/scripts/download-content.ts +++ b/scripts/download-content.ts @@ -22,14 +22,17 @@ export async function downloadDocs() { } export async function downloadExamples() { - console.log(`Downloading examples from appwrite/appwrite (branch: ${appwriteExamplesBranch})`); + console.log(`Downloading examples from appwrite/appwrite (version: ${appwriteExamplesBranch})`); const owner = "appwrite"; const repo = "appwrite"; const docsSubdirPath = `docs/examples/${appwriteExamplesBranch}`; + // The version-pinned example folders (docs/examples/) only live on the + // `main` branch; they were removed from the per-version branches like 1.8.x. + const ref = "main"; console.log(`Downloading examples from ${owner}/${repo}/${docsSubdirPath} to ${examplesTargetDir}`); - const downloadResult = await downloadTemplate(`gh:${owner}/${repo}/${docsSubdirPath}#${appwriteExamplesBranch}`, { + const downloadResult = await downloadTemplate(`gh:${owner}/${repo}/${docsSubdirPath}#${ref}`, { dir: examplesTargetDir, forceClean: true, });