anime-database-sync/.github/workflows/backup.yml
2021-09-29 11:07:15 +02:00

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@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'