mirror of
https://github.com/MALSync/MAL-Sync-Backup.git
synced 2023-09-22 11:52:49 +02:00
38 lines
903 B
YAML
38 lines
903 B
YAML
on:
|
|
schedule:
|
|
- cron: '0 0 * * 0'
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- master
|
|
name: Backup
|
|
jobs:
|
|
backup:
|
|
name: Backup
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@master
|
|
with:
|
|
ref: master
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16.x'
|
|
- name: Build
|
|
run: npm install
|
|
- name: Backup
|
|
run: npm run backup
|
|
env:
|
|
DOMAIN: ${{ secrets.DOMAIN }}
|
|
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
|
|
- name: Commit files
|
|
run: |
|
|
git add data/*
|
|
git add README.md
|
|
git config --local user.email "action@github.com"
|
|
git config --local user.name "GitHub Action"
|
|
git commit -m "weekly backup" -a
|
|
- name: Push changes
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
branch: 'master'
|