Create update-mod.yml
This commit is contained in:
parent
7e865e1ab7
commit
8f350fb36d
1 changed files with 42 additions and 0 deletions
42
.github/workflows/update-mod.yml
vendored
Normal file
42
.github/workflows/update-mod.yml
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
name: Update Mod from CurseForge
|
||||||
|
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: '0 0 * * *' # Runs at midnight once a day
|
||||||
|
workflow_dispatch: # Enables manual triggering
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
update-mod:
|
||||||
|
runs-on: ubuntu-24.04 # Explicitly specify ubuntu-24.04
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
|
||||||
|
- name: Create package.json
|
||||||
|
run: |
|
||||||
|
echo '{"type": "module"}' > package.json # Add "type": "module"
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm install curseforge-api node-fetch
|
||||||
|
|
||||||
|
- name: Fetch latest server files
|
||||||
|
env:
|
||||||
|
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
|
||||||
|
run: node fetch_latest_server_files.js
|
||||||
|
|
||||||
|
- name: Commit and push changes
|
||||||
|
env:
|
||||||
|
USER_NAME: ${{ secrets.USER_NAME }}
|
||||||
|
USER_EMAIL: ${{ secrets.USER_EMAIL }}
|
||||||
|
run: |
|
||||||
|
git config --global user.name $USER_NAME
|
||||||
|
git config --global user.email $USER_EMAIL
|
||||||
|
git add -A
|
||||||
|
git commit -m 'Update launch.sh and Dockerfile with latest server file info'
|
||||||
|
git push
|
||||||
Loading…
Add table
Add a link
Reference in a new issue