---
name: Clean GitHub pages

on: delete

jobs:
  clean:
    runs-on: ubuntu-18.04
    name: Clean GitHub pages
    timeout-minutes: 5

    steps:
      - uses: actions/checkout@v1
        with:
          ref: gh-pages
      - name: Clean ghpages
        run: |
          git config --global user.name "Continuous integration"
          git config --global user.email "ci@comptocamp.org"
          if [ -d $(cat ${GITHUB_EVENT_PATH}|jq --raw-output .ref) ]
          then
            git rm -r $(cat ${GITHUB_EVENT_PATH}|jq --raw-output .ref)
            git commit -m "Clean branch $(cat ${GITHUB_EVENT_PATH}|jq --raw-output .ref)"
            remote_repo="https://${GITHUB_ACTOR}:${{ github.token }}@github.com/camptocamp/ngeo.git"
            git push "${remote_repo}" gh-pages --force
          fi

---
name: Clean GitHub pages

on: delete

jobs:
  clean:
    runs-on: ubuntu-18.04
    name: Clean GitHub pages
    timeout-minutes: 5

    steps:
      - uses: actions/checkout@v1
        with:
          ref: gh-pages
      - name: Clean ghpages
        run: |
          git config --global user.name "Continuous integration"
          git config --global user.email "ci@comptocamp.org"
          if [ -d $(cat ${GITHUB_EVENT_PATH}|jq --raw-output .ref) ]
          then
            git rm -r $(cat ${GITHUB_EVENT_PATH}|jq --raw-output .ref)
            git commit --amend
            remote_repo="https://${GITHUB_ACTOR}:${{ github.token }}@github.com/camptocamp/ngeo.git"
            git push "${remote_repo}" gh-pages --force
          fi

Fix the clean of gh-pages
Fix the clean of gh-pages
