Skip to content

.github/workflows/ruffle-update.yml #5

.github/workflows/ruffle-update.yml

.github/workflows/ruffle-update.yml #5

Workflow file for this run

name: Update Ruffle
on:
schedule:
- cron: '0 0 * * *' # run everyday at midnight
workflow_dispatch: # allows manual trigger
jobs:
update:
runs-on: self-hosted # use selfhosted runner
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Setup Node.js environment
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install 20
- name: Download Ruffle
run: |
curl -o ruffle.zip -L https://github.com/ruffle-rs/ruffle/releases/latest/download/ruffle_web_latest.zip
unzip ruffle.zip -d ruffle_new
- name: Backup existing Ruffle
run: |
mv ruffle ruffle_backup || true
- name: Copy new Ruffle files
run: |
cp -r ruffle_new/. ruffle/
- name: Remove old Ruffle
run: |
rm -rf ruffle_backup
- name: Commit and push if it changed
run: |
git config user.name "Ruffle Updater"
git config user.email "xordas@xordas.me"
git add -A
git diff --quiet && git diff --staged --quiet || git commit -m "Update Ruffle"
git push