Skip to content

Commit

Permalink
fix(scripts): push to correct directories (#3211)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts authored Jun 19, 2024
1 parent 8999f67 commit d55eee1
Showing 1 changed file with 8 additions and 7 deletions.
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

1 comment on commit d55eee1

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please # to comment.