-
Notifications
You must be signed in to change notification settings - Fork 10
60 lines (51 loc) · 1.53 KB
/
action.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
54
55
56
57
58
59
60
name: Run SQLite Task
on:
schedule:
- cron: '0 * * * *' # Run every hour
workflow_dispatch:
push:
branches:
- main
jobs:
sqlite-job:
runs-on: ubuntu-latest
permissions:
contents: write
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '23'
- name: Add mask for secrets
run: |
echo '${{ secrets.ENV_SECRETS }}' | jq -r 'to_entries | .[] | .value' | while read -r value; do
echo "::add-mask::$value"
done
- name: Set environment variables
run: |
echo '${{ secrets.ENV_SECRETS }}' | jq -r 'to_entries | .[] | "echo \(.key)=\(.value) >> $GITHUB_ENV"' | sh
- name: Install dependencies
run: npm install
- name: Run index.js
run: npm run dev
env:
RUN_ONCE: true
- name: Copy latest JSON to daily.json
run: |
LATEST_JSON=$(ls ./json/*2025-*-*.json | sort -V | tail -n1)
cp "$LATEST_JSON" ./json/daily.json
- name: Commit and Push Changes
run: |
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git add ./data/db.sqlite
git add ./json/
git commit -m "Update from collection"
git push