<commit_before>name: Build documentation + upload to gh-pages

on:
  #push:
  #  branches:
  #    - gh-pages-docs
  schedule:
    - cron: '37 10 * * SAT'
  workflow_dispatch:

check_commit:
  runs-on: ubuntu-latest
  name: Checks for latest commit
  outputs:
    should_run: ${{ steps.should_run.outputs.should_run }}
  steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 1
        submodules: false
    - name: Print the latest commit
      run: echo ${{ github.sha }}

    - id: should_run
      continue-on-error: true
      name: Check the latest commit is within 1 week
      if: ${{ github.event_name == 'schedule' }}
      run: test -z $(git rev-list --after="1 week" --max-count=1 ${{ github.sha }}) && echo "::set-output name=should_run::false"

jobs:
  build:
    # check that a commit has actually been made and only run if a commit has been made within the last week
    needs: check_commit
    if: ${{ needs.check_commit.outputs.should_run != 'false' }}

    runs-on: ubuntu-latest

    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2
        with:
          # The files submodule is required for viz documentation
          submodules: true
          # the files submodule uses lfs
          lfs: true

      # This should generally not be required, but in the end it is just easier
      - name: Ensure system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install gfortran

      - name: Setup python environment
        uses: actions/setup-python@v2
        with:
          python-version: '3.9'

      - name: Install sisl + documentation dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install Cython
          python -m pip install .[viz]
          python -m pip install -r docs/requirements.txt
        
      - uses: r-lib/actions/setup-pandoc@v1 

      - name: Build the documentation using the sisl-files as well
        run: |
          cd docs
          SISL_FILES_TESTS=${GITHUB_WORKSPACE}/files/tests make html
          rm -rf build/html/_sources
          cd ..
        
      # Deploy to github pages
      - name: Deploy to github pages
        uses: JamesIves/github-pages-deploy-action@4.1.5
        with:
          BRANCH: gh-pages
          FOLDER: docs/build/html
          GITHUB_TOKEN: ${{ github.token }}
<commit_msg>bug: trying to add the nojekyll page<commit_after>name: Build documentation + upload to gh-pages

on:
  #push:
  #  branches:
  #    - gh-pages-docs
  schedule:
    - cron: '37 10 * * SAT'
  workflow_dispatch:

check_commit:
  runs-on: ubuntu-latest
  name: Checks for latest commit
  outputs:
    should_run: ${{ steps.should_run.outputs.should_run }}
  steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 1
        submodules: false
    - name: Print the latest commit
      run: echo ${{ github.sha }}

    - id: should_run
      continue-on-error: true
      name: Check the latest commit is within 1 week
      if: ${{ github.event_name == 'schedule' }}
      run: test -z $(git rev-list --after="1 week" --max-count=1 ${{ github.sha }}) && echo "::set-output name=should_run::false"

jobs:
  build:
    # check that a commit has actually been made and only run if a commit has been made within the last week
    needs: check_commit
    if: ${{ needs.check_commit.outputs.should_run != 'false' }}

    runs-on: ubuntu-latest

    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2
        with:
          # The files submodule is required for viz documentation
          submodules: true
          # the files submodule uses lfs
          lfs: true

      # This should generally not be required, but in the end it is just easier
      - name: Ensure system dependencies
        run: |
          sudo apt-get update
          sudo apt-get install gfortran

      - name: Setup python environment
        uses: actions/setup-python@v2
        with:
          python-version: '3.9'

      - name: Install sisl + documentation dependencies
        run: |
          python -m pip install --upgrade pip
          python -m pip install Cython
          python -m pip install .[viz]
          python -m pip install -r docs/requirements.txt
        
      - uses: r-lib/actions/setup-pandoc@v1 

      - name: Build the documentation using the sisl-files as well
        run: |
          cd docs
          SISL_FILES_TESTS=${GITHUB_WORKSPACE}/files/tests make html
          rm -rf build/html/_sources
          touch build/html/.nojekyll
          cd ..
        
      # Deploy to github pages
      - name: Deploy to github pages
        uses: JamesIves/github-pages-deploy-action@4.1.5
        with:
          BRANCH: gh-pages
          FOLDER: docs/build/html
          GITHUB_TOKEN: ${{ github.token }}

{'fraction_non_alphanumeric': 0.0906515580736544, 'fraction_numerical': 0.006879805746661271, 'mean_word_length': 2.021393643031785, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4130572', 'n_tokens_mistral': 1524, 'n_tokens_neox': 1449, 'n_words': 478}