-
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) 路 1.51 KB
/
Copy pathworkflow.yml
File metadata and controls
52 lines (43 loc) 路 1.51 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
name: Run Index.js
on:
push:
branches:
- main # Triggers on push to the main branch
workflow_dispatch: # Allows manual triggering via the GitHub UI
schedule:
- cron: '0 */3 * * *'
jobs:
run-index:
runs-on: ubuntu-latest
steps:
# Checkout the code
- name: Checkout code
uses: actions/checkout@v4
# Set up Node.js
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
# Install dependencies
- name: Install dependencies
run: npm install
# Run the index.js script
- name: Run index.js
run: npm run start
# Run the logger script
- name: Run logger.js
run: npm run logger
# Run the snippets script
- name: Run snippets.js
run: npm run snippets
# Commit and push changes if there are any changes
- name: Commit and Push changes
run: |
git config --global user.name "${{ secrets.USERNAME }}"
git config --global user.email "${{ secrets.EMAIL }}"
git add .
git diff --cached
git commit -m "New Data Detected && Updated Webpack Version" || echo "No changes to commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}