mirror of
https://github.com/MALSync/MAL-Sync-Backup.git
synced 2023-09-22 11:52:49 +02:00
38 lines
882 B
YAML
38 lines
882 B
YAML
|
on:
|
||
|
schedule:
|
||
|
- cron: '0 0 * * 0'
|
||
|
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@v1
|
||
|
with:
|
||
|
node-version: '14.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'
|