Skip to content

Commit

Permalink
config🔧: test ci
Browse files Browse the repository at this point in the history
  • Loading branch information
isboyjc committed Aug 1, 2024
1 parent 7578e65 commit dd62c40
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 23 deletions.
45 changes: 23 additions & 22 deletions .github/workflows/run.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,41 @@ name: Fetch GitHub Trending

on:
push:
branches: [ main ]
schedule:
- cron: '* 16 * * *'
branches:
- main
pull_request:
branches:
- main
# schedule:
# - cron: '* 16 * * *'

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup node.js environment
uses: actions/setup-node@v1
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Install Dependencies & Run Script
run: |
# Run script
npm ci
npm run dev --if-present
- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install

- name: Configure Git
- name: Build the project
run: pnpm run build

- name: Commit and Push changes
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Commit changes
run: |
git checkout main
git add -A
git diff --quiet && git diff --staged --quiet || (git commit -m ":rocket: Fetch GitHub Trending at $(date +'%Y-%m-%d %H:%M')")
- name: Push changes
git add .
git commit -m ":rocket: Fetch GitHub Trending at $(date +'%Y-%m-%d %H:%M')"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "",
"main": "index.js",
"scripts": {
"dev": "node ./script/index.js",
"build": "node ./script/index.js",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
Expand Down

0 comments on commit dd62c40

Please sign in to comment.