name: documentation
on:
  push:
    branches:
      - master
    paths:
      - 'docs/**'
      - 'resources/**'
      - 'tools/**'
  pull_request:
    paths:
      - 'docs/**'
      - 'resources/**'
      - 'tools/**'
jobs:
  build-and-publish:
    runs-on: ubuntu-18.04
    steps:
    - name: Checkout
      uses: actions/checkout@v1
      with:
        fetch-depth: 50
    - name: Run website_build.sh
      # Use a conditional step instead of a conditional job to work around #20700.
      if: github.repository == 'web-platform-tests/wpt'
      uses: ./tools/docker/documentation
      env:
        DEPLOY_TOKEN: ${{ secrets.DEPLOY_TOKEN }}
      with:
        entrypoint: /bin/bash
        args: tools/ci/website_build.sh
