added: github actions check for ts-node package #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |