name: Buils
on:
  push:
    branches:
      - master
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Node.js environment
        uses: actions/setup-node@v1.4.4
        
      - name: Setup Java JDK
        uses: actions/setup-java@v1.4.3
        with:
          java-version: 15

      - name: Build the server
        run: ./build.sh

      - name: Run Cypress tests
        uses: cypress-io/github-action@v2
        with:
          build: docker-compose -f ../docker-compose.yml up -d --build
          start: docker-compose -f ../docker-compose.yml ps
          wait-on: 'http://localhost:8080/login'
          wait-on-timeout: 180
          working-directory: frontend
          record: true
        env:
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Build a Docker container
        uses: docker/build-push-action@v1
        with:
          registry: docker.pkg.github.com
          repository: ${{ github.repository }}/server
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
          tag_with_ref: true
          tags: latest
name: Build
on:
  push:
    branches:
      - '**'
    tags:
      - '*'
  pull_request:
  workflow_dispatch:
jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2

      - name: Setup Node.js environment
        uses: actions/setup-node@v2
        
      - name: Setup Java JDK
        uses: actions/setup-java@v2
        with:
          distribution: 'zulu'
          java-version: 15

      - name: Build the server
        run: ./build.sh

      - name: Run Cypress tests
        uses: cypress-io/github-action@v2
        with:
          build: docker-compose -f ../docker-compose.yml up -d --build
          start: docker-compose -f ../docker-compose.yml ps
          wait-on: 'http://localhost:8080/login'
          wait-on-timeout: 180
          working-directory: frontend
          record: true
        env:
          CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

      - name: Build a Docker container
        uses: docker/build-push-action@v1
        if: startsWith(github.ref, 'refs/tags/v')
        with:
          registry: docker.pkg.github.com
          repository: ${{ github.repository }}/server
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
          tag_with_ref: true
          tags: latest
Add continuous integration for pull requests and other branches
[68] Add continuous integration for pull requests and other branches

Bug: https://github.com/svalyn/svalyn/issues/68
Signed-off-by: Stéphane Bégaudeau <fa7070c1dfe48b69ae467d915a7a33333baf63a2@gmail.com>
