Skip to content

Commit 89195f9

Browse files
authored
Merge pull request #16 from appwrite/fix-issues-around-build
chore: extract branch from download of examples
2 parents 265d167 + 2b3a3fc commit 89195f9

2 files changed

Lines changed: 33 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout the repo
13+
uses: actions/checkout@v6
14+
15+
- name: Install Bun
16+
uses: oven-sh/setup-bun@v2
17+
18+
- name: Install dependencies
19+
run: bun install --frozen-lockfile
20+
21+
- name: Apply patches
22+
run: npx patch-package
23+
24+
- name: Build
25+
run: bun run build
26+
27+
- name: Download content
28+
run: bun run download-content

scripts/download-content.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ export async function downloadDocs() {
2222
}
2323

2424
export async function downloadExamples() {
25-
console.log(`Downloading examples from appwrite/appwrite (branch: ${appwriteExamplesBranch})`);
25+
console.log(`Downloading examples from appwrite/appwrite (version: ${appwriteExamplesBranch})`);
2626

2727
const owner = "appwrite";
2828
const repo = "appwrite";
2929
const docsSubdirPath = `docs/examples/${appwriteExamplesBranch}`;
30+
// The version-pinned example folders (docs/examples/<version>) only live on the
31+
// `main` branch; they were removed from the per-version branches like 1.8.x.
32+
const ref = "main";
3033

3134
console.log(`Downloading examples from ${owner}/${repo}/${docsSubdirPath} to ${examplesTargetDir}`);
32-
const downloadResult = await downloadTemplate(`gh:${owner}/${repo}/${docsSubdirPath}#${appwriteExamplesBranch}`, {
35+
const downloadResult = await downloadTemplate(`gh:${owner}/${repo}/${docsSubdirPath}#${ref}`, {
3336
dir: examplesTargetDir,
3437
forceClean: true,
3538
});

0 commit comments

Comments
 (0)