Skip to content

Commit

Permalink
Merge branch 'master' into set_up_azure_batch_pool
Browse files Browse the repository at this point in the history
  • Loading branch information
adamrtalbot authored Dec 2, 2024
2 parents 139a8c8 + c0fb6ec commit 4dc310a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build-nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Trigger Netlify Build
on:
schedule:
- cron: '0 2 * * *' # Once a day
workflow_dispatch: # On demand
jobs:
build:
name: Request Netlify Webhook
runs-on: ubuntu-latest
steps:
- name: POST to Build Hook
run: curl -X POST -d {} ${{ secrets.NETLIFY_BUILD_HOOK_URL }}
31 changes: 18 additions & 13 deletions internal/fetch-docs-oss.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,38 @@ const __dirname = path.dirname(__filename);

const repositories = [
{
name: 'multiqc',
url: 'https://github.com/MultiQC/MultiQC.git',
path: path.join(__dirname, "..", "multiqc_docs", "multiqc_repo")
name: "multiqc",
url: "https://github.com/MultiQC/MultiQC.git",
path: path.join(__dirname, "..", "multiqc_docs", "multiqc_repo"),
branch: "main",
},
{
name: 'wave',
url: 'https://github.com/seqeralabs/wave.git',
path: path.join(__dirname, "..", "wave_docs", "wave_repo")
}
name: "wave",
url: "https://github.com/seqeralabs/wave.git",
path: path.join(__dirname, "..", "wave_docs", "wave_repo"),
branch: "master",
},
];

// Function to clone or update a repository
async function cloneOrUpdateRepo({ name, url, path: repoPath }) {
async function cloneOrUpdateRepo({ name, url, path: repoPath, branch }) {
const exists = await fs.pathExists(repoPath + "/.git");

try {
if (exists) {
console.log(`${name}: Cloned repo already exists, will pull latest changes`);
await git(repoPath).pull();
console.log(
`${name}: Cloned repo already exists, will pull latest changes`,
);
// pull and checkout the branch
await git(repoPath).pull("origin", branch);
console.log(`✅ ${name}: Pulled latest changes`);
} else {
console.log(`${name}: Cloning into ${repoPath}`);
await git().clone(url, repoPath);
console.log(`✅ ${name}: Cloned`);
}
} catch (error) {
console.error(`❌ Error processing ${repo.name}:`);
console.error(`❌ Error processing ${repoPath}:`);
console.error(error.message);
if (exists) {
console.error(`Try removing the directory: ${repoPath}`);
Expand All @@ -59,4 +64,4 @@ async function processRepositories() {
}

// Execute
processRepositories().catch(console.error);
processRepositories().catch(console.error);

0 comments on commit 4dc310a

Please sign in to comment.