-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (43 loc) · 1.75 KB
/
deploy.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
48
49
50
51
52
53
name: Deploy Docusaurus site
on:
push:
branches:
- main # Trigger deployment on push to 'main' branch
jobs:
build:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout the repository
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18 # Adjust based on your Node.js version
# Step 3: Install dependencies (including ts-node)
- name: Install dependencies
run: yarn install
# Step 4: Verify ts-node installation (for debugging)
- name: Check ts-node version
run: yarn ts-node -v # This ensures ts-node is installed and available
# Step 5: Run the script to generate the necessary file (rust-library.ts)
- name: Run rust-library.ts script to generate files
run: yarn ts-node scripts/rust-library.ts
# Step 6: Verify that the file is generated (for debugging purposes)
- name: Verify file existence
run: |
if [ ! -f "./docs/get-started/cardano-serialization-lib/transaction-metadata.md" ]; then
echo "File not found after script execution: ./docs/get-started/cardano-serialization-lib/transaction-metadata.md"
exit 1
else
echo "File exists after script execution: ./docs/get-started/cardano-serialization-lib/transaction-metadata.md"
fi
# Step 7: Build the Docusaurus site
- name: Build Docusaurus site
run: yarn build
# Step 8: Deploy the Docusaurus site to GitHub Pages
- name: Deploy to GitHub Pages
run: yarn deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub automatically provides this token