name: Autocompile

on:
  workflow_dispatch:
  # push:
  #   branches: [ "main" ]
  # pull_request:
  #   branches: [ "main" ]

jobs:
  build:
    name: Build scraper
    runs-on: ubuntu-latest
    permissions:
      contents: write
    steps:
    - name: Checkout main branch
      uses: actions/checkout@v3
    - name: Compile (make)
      run: |
        cd bin
        make
    - name: Push compiled binary
      run: |
        git config --global user.name "Quatalog Compiler"
        git config --global user.email "github_actions@quatalog.com"
        git add bin
        git commit -m "Recompile scraper : $(date)" || exit 0
        git push
