-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (40 loc) · 1.15 KB
/
transform.yml
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
name: Transform MDX Files
on:
pull_request:
push:
branches:
- main
- develop
workflow_dispatch: # Allow manual runs
jobs:
transform-mdx:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
# Step 3. Install pnpm
- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8.15.8
- name: Install dependencies
run: pnpm install
# Step 4: Run the transformation script
- name: Transform MDX to MD and Components
run: node ./src/scripts/transform-mdx.js
# Step 5 (Optional): Commit changes
- name: Commit changes
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git add __translations__/ content/
git commit -m "Run MDX transformation script" || echo "No changes to commit"
git push