name: Keybindings Docs

on:
  push:
    branches:
      - master

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout VSpaceCode
      uses: actions/checkout@v2
      with:
        path: VSpaceCode

    - name: Generate KEYBINDINGS.md
      run: |
        cd VSpaceCode
        npm install
        npm run generate-keybindings

    - name: Checkout vspacecode.github.io
      uses: actions/checkout@v2
      with:
        repository: VSpaceCode/vspacecode.github.io
        path: vspacecode.github.io
    
    - name: Move KEYBINDINGS.md
      run: |
        cd vspacecode.github.io/docs
        rm default-keybindings.md
        mv ../../VSpaceCode/KEYBINDINGS.md default-keybindings.md
        prepending='---\nid: default-keybindings\ntitle: Default Keybindings\n---\n\n<!-- AUTO GENERATED. DO NOT MODIFY MANUALLY -->\n\n'
        echo -e "$prepending$(cat default-keybindings.md)" > default-keybindings.md

    - name: Commit and Push
      run: |
        cd vspacecode.github.io/docs
        git config user.name github-actions
        git config user.email github-actions@github.com
        git add default-keybindings.md
        git commit -m "Update default keybindings"
        git push
name: Keybindings Docs

on:
  push:
    branches:
      - master

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout VSpaceCode
      uses: actions/checkout@v2
      with:
        path: VSpaceCode

    - name: Generate KEYBINDINGS.md
      run: |
        cd VSpaceCode
        npm install
        npm run generate-keybindings

    - name: Checkout vspacecode.github.io
      uses: actions/checkout@v2
      with:
        repository: VSpaceCode/vspacecode.github.io
        path: vspacecode.github.io
        ssh-key: ${{ secrets.KEYBINDING_DEPLOY }}
    
    - name: Move KEYBINDINGS.md
      run: |
        cd vspacecode.github.io/docs
        rm default-keybindings.md
        mv ../../VSpaceCode/KEYBINDINGS.md default-keybindings.md
        prepending='---\nid: default-keybindings\ntitle: Default Keybindings\n---\n\n<!-- AUTO GENERATED. DO NOT MODIFY MANUALLY -->\n\n'
        echo -e "$prepending$(cat default-keybindings.md)" > default-keybindings.md

    - name: Commit and Push
      run: |
        cd vspacecode.github.io/docs
        git config user.name github-actions
        git config user.email github-actions@github.com
        git add default-keybindings.md
        git commit -m "Update default keybindings"
        git push
Add ssh-key for keybinding doc deployment
Add ssh-key for keybinding doc deployment
