anime-database-sync/.github/workflows/backup.yml

39 lines
903 B
YAML
Raw Normal View History

2021-06-15 09:52:18 +02:00
on:
schedule:
- cron: '0 0 * * 0'
2021-09-29 11:07:15 +02:00
workflow_dispatch:
2021-06-15 09:52:18 +02:00
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'