name: CI

on: [push, pull_request, repository_dispatch]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        persist-credentials: false
    - uses: actions/setup-node@v1
      with:
        node-version: '10.x'
    - uses: krdlab/setup-haxe@v1
    - name: Build Docker Image
      run: node scripts/docker.js buildImage
    - name: Build Site
      run: |
        ls -lah
        node scripts/docker.js buildSite
        ls -lah
        haxe --run RemoveRedirects
    - name: Highlighting
      run: |
        git clone --recursive https://github.com/Gama11/Highlighter
        cd Highlighter
        npm install
        node bin/highlighter.js ../out
        cd ..
    - name: Deploy Master
      uses: JamesIves/github-pages-deploy-action@3.4.3
      with:
        ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}}
        BRANCH: gh-pages
        FOLDER: out
        SINGLE_COMMIT: true
      if: github.ref == 'refs/heads/master'
    - name: Deploy Dev
      uses: JamesIves/github-pages-deploy-action@3.4.3
      with:
        ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}}
        BRANCH: gh-pages
        FOLDER: out
        SINGLE_COMMIT: true
        REPOSITORY_NAME: HaxeFlixel/dev.haxeflixel.com
      if: github.ref == 'refs/heads/dev'

name: CI

on: [push, pull_request, repository_dispatch]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        persist-credentials: false
    - uses: actions/setup-node@v1
      with:
        node-version: '10.x'
    - uses: krdlab/setup-haxe@v1
    - name: Build Docker Image
      run: node scripts/docker.js buildImage
    - name: Build Site
      run: |
        ls -lah
        node scripts/docker.js buildSite
        ls -lah
        haxe --run RemoveRedirects
    - name: Highlighting
      run: |
        git clone --recursive https://github.com/Gama11/Highlighter
        cd Highlighter
        npm install
        node bin/highlighter.js ../out
        cd ..
    - name: Deploy Master
      uses: peaceiris/actions-gh-pages@v3
      with:
        github_token: ${{secrets.GITHUB_TOKEN}}
        publish_dir: ./out
        force_orphan: true
        cname: haxeflixel.com
      if: github.ref == 'refs/heads/master'
    - name: Deploy Dev
      uses: peaceiris/actions-gh-pages@v3
      with:
        personal_token: ${{secrets.ACCESS_TOKEN}}
        publish_dir: ./out
        force_orphan: true
        cname: dev.haxeflixel.com
        external_repository: HaxeFlixel/dev.haxeflixel.com
      if: github.ref == 'refs/heads/dev'

Switch to a different GH pages action
Switch to a different GH pages action
