name: CI
on: [push, pull_request]
jobs:
  try:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    strategy:
      matrix:
        ember-version:
          - 'ember-default'
          - 'ember-lts-3.12'
          - 'ember-lts-3.16'
          - 'ember-release'
          - 'ember-beta'
          - 'ember-canary'
    env:
      CI: true
      EMBER_TRY_SCENARIO: ${{ matrix.ember-version }}

    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v2.1.5
    - run: yarn install
    - run: node_modules/.bin/ember try:one $EMBER_TRY_SCENARIO --skip-cleanup
      continue-on-error: ${{ matrix.ember-version == 'ember-canary' }}

  docs:
    runs-on: ubuntu-latest
    timeout-minutes: 15
    needs: []
    if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v2.1.5
    - run: yarn install
    - uses: webfactory/ssh-agent@v0.1.1
      with:
        ssh-private-key: ${{ secrets.DEPLOY_KEY }}
    - run: git config --global user.email "github.actions@example.com"
    - run: git config --global user.name "Github Action"
    - run: node_modules/.bin/ember deploy production
      continue-on-error: true

