name: Build Shadowrocket Rules

on:
  schedule:
    # 每日8时开始
    - cron:  '0 23 * * *'
  
  push:
    branches:
      - master
    paths-ignore: 
      - '**.md'
      - 'LICENSE'

  workflow_dispatch:
  
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2

      - name: Install requirements
        run: pip3 install -r requirements.txt

      - name: Run auto-build.sh
        run: ./factory/auto_build.sh
        
      - name: Deploy
        uses: JamesIves/github-pages-deploy-action@4.1.7
        with:
          BRANCH: master
          FOLDER: .
          commit-message : 'Nightly build'
          
