-
-
Notifications
You must be signed in to change notification settings - Fork 44k
57 lines (44 loc) · 1.49 KB
/
sync-repo-to-database.yml
File metadata and controls
57 lines (44 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Sync Repo to Database
on:
workflow_dispatch:
inputs:
roadmap_slug:
description: "The slug of the roadmap to sync (e.g., frontend, backend)"
required: true
jobs:
sync-roadmap:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup pnpm@v9
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Setup Node.js Version 20 (LTS)
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Get all roadmap files
id: roadmap-files
run: |
ROADMAP_DIR="src/data/roadmaps/${{ inputs.roadmap_slug }}"
if [ ! -d "$ROADMAP_DIR" ]; then
echo "Error: Roadmap directory '$ROADMAP_DIR' does not exist"
exit 1
fi
echo "Getting all files in $ROADMAP_DIR"
ALL_FILES=$(find "$ROADMAP_DIR" -type f | tr '\n' ',')
echo "Files to sync:"
echo "$ALL_FILES"
echo "files=$ALL_FILES" >> $GITHUB_OUTPUT
- name: Install Dependencies
run: |
echo "Installing Dependencies"
pnpm install
- name: Run sync script
run: |
echo "Running sync script for roadmap: ${{ inputs.roadmap_slug }}"
echo "Files: ${{ steps.roadmap-files.outputs.files }}"
npm run sync:repo-to-database -- --files="${{ steps.roadmap-files.outputs.files }}" --secret=${{ secrets.GH_SYNC_SECRET }}