name: Runtime
on:
  push:
    branches:
      - v2-alpha
    paths:
      - 'v2/internal/frontend/runtime/**'
jobs:
  rebuild-runtime:
    name: Rebuild the runtime
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: 14.17.6
          cache: 'npm'
          cache-dependency-path: v2/internal/frontend/runtime/package-lock.json
      - run: npm install
        working-directory: v2/internal/frontend/runtime
      - run: npm run build
        working-directory: v2/internal/frontend/runtime

      - name: Commit changes
        uses: devops-infra/action-commit-push@master
        with:
          github_token: "${{ secrets.GITHUB_TOKEN }}"
          commit_prefix: "[AUTO]"
          commit_message: "The runtime was rebuilt"
