Skip to content

Commit

Permalink
Create run_node.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
andifahruddinakas authored Oct 23, 2024
1 parent 4748d6c commit b24ab8a
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/run_node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Run Node.js and Commit Results

on:
push:
branches:
- main # Sesuaikan dengan branch yang Anda gunakan

jobs:
run-and-commit:
runs-on: ubuntu-latest

steps:
# Step 1: Checkout kode dari repository
- name: Checkout repository
uses: actions/checkout@v3

# Step 2: Setup Node.js environment
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18' # Sesuaikan versi Node.js jika diperlukan

# Step 3: Install dependencies
- name: Install dependencies
run: npm install

# Step 4: Jalankan perintah yang diperlukan
- name: Run Node script
run: node index.js 94.csv

# Step 5: Commit perubahan jika ada file yang diubah/dihasilkan
- name: Commit changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add .
git commit -m "Commit generated files from Node script" || echo "No changes to commit"
# Step 6: Push commit ke repository
- name: Push changes
uses: ad-m/github-push-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main # Sesuaikan dengan branch yang Anda gunakan

0 comments on commit b24ab8a

Please sign in to comment.