Node.js CI #110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js CI | |
on: | |
watch: | |
types: started | |
schedule: | |
- cron: '00 0 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'latest' | |
- name: Download list | |
run : | | |
echo "$(date)" > output/.lastrun | |
npm install | |
npm audit fix --force | |
node download --output output/all-cdn.txt | |
for f in providers/*.js; do | |
FILENAME=${f%%.*}; | |
FILENAME=${FILENAME##*/}; | |
node download --provider ${FILENAME} --output output/${FILENAME}.txt; | |
done; | |
- name: Upload files | |
uses: actions/upload-artifact@v4 | |
with: | |
path: output/ | |
- name: Apply | |
run: | | |
Emoji=("🎉" "🤞" "✨" "🎁" "🎈" "🎄" "🎨" "💋" "🍓" "🍕" "🍉" "💐" "🌴" "🚀" "🛸" "🗽" "⛅" "🌈" "🔥" "⛄" "🐶" "🏅" "🦄" "🐤") | |
git add . | |
git commit -m "${Emoji[$[$RANDOM % ${#Emoji[@]}]]} Sync $(date +%Y-%m-%d" "%H:%M:%S)" | |
git push -f |