Skip to content

Update CSV and TXT Files #91

Update CSV and TXT Files

Update CSV and TXT Files #91

Workflow file for this run

name: Update CSV and TXT Files
on:
schedule:
- cron: '0 21 * * *'
workflow_dispatch:
jobs:
update-files:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
cache-dependency-path: scripts/package-lock.json
- name: Change to scripts directory
run: cd scripts
- name: Install dependencies
run: |
cd scripts
npm ci
- name: Run main script
run: |
cd scripts
node main.js
env:
NOIP_USERNAME: ${{ secrets.NOIP_USERNAME }}
NOIP_PASSWORD: ${{ secrets.NOIP_PASSWORD }}
GSLB_USERNAME: ${{ secrets.GSLB_USERNAME }}
GSLB_PASSWORD: ${{ secrets.GSLB_PASSWORD }}
CLOUDDNS_USERNAME: ${{ secrets.CLOUDDNS_USERNAME }}
CLOUDDNS_PASSWORD: ${{ secrets.CLOUDDNS_PASSWORD }}
- name: Commit and push if there are changes
run: |
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action"
git add -A
git commit -m "Automatically update .csv and .txt files" || exit 0
git push https://${{ secrets.ADMIN_GH_TOKEN }}@github.com/${{ github.repository }}.git