Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(scripts): push to correct directories #3211

Merged
merged 1 commit into from
Jun 19, 2024
Merged
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
15 changes: 8 additions & 7 deletions scripts/ci/codegen/pushToAlgoliaDoc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import fsp from 'fs/promises';
import { resolve } from 'path';

import {
emptyDirExceptForDotGit,
gitCommit,
run,
toAbsolutePath,
Expand Down Expand Up @@ -44,12 +43,14 @@ async function pushToAlgoliaDoc(): Promise<void> {
await run(`git clone --depth 1 ${githubURL} ${tempGitDir}`);
await run(`git checkout -B ${targetBranch}`, { cwd: tempGitDir });

const dest = toAbsolutePath(`${tempGitDir}/app_data/api/specs`);
await emptyDirExceptForDotGit(dest);
await run(`cp ${toAbsolutePath('specs/bundled/*.doc.yml')} ${dest}`);
await run(`cp ${toAbsolutePath('config/release.config.json')} ${dest}`);
await run(`cp ${toAbsolutePath('website/src/generated/*.json')} ${dest}`);
await run(`cp ${toAbsolutePath('website/static/img/*-sla.png')} ${dest}`);
const pathToSpecs = toAbsolutePath(`${tempGitDir}/app_data/api/specs`);
const pathToImages = toAbsolutePath(`${tempGitDir}/assets/images/api`);
await run(`cp ${toAbsolutePath('specs/bundled/*.doc.yml')} ${pathToSpecs}`);
await run(`cp ${toAbsolutePath('config/release.config.json')} ${pathToSpecs}`);
await run(`cp ${toAbsolutePath('website/src/generated/*.json')} ${pathToSpecs}`);
await run(
`mkdir -p ${pathToImages} && cp ${toAbsolutePath('website/static/img/*-sla.png')} ${pathToImages}`,
);

if ((await getNbGitDiff({ head: null, cwd: tempGitDir })) === 0) {
console.log(`❎ Skipping push docs because there is no change.`);
Expand Down
Loading