docker.yml 612 bytes
name: Docker
on:
  push:
    branches: [master]
  pull_request:
    branches: [master]
jobs:
  build:
    runs-on: ubuntu-20.04
    timeout-minutes: 40
    steps:
    - uses: actions/checkout@v2
    - name: Build container image
      run: docker build -t test-container-image .
    - name: Launch container
      run: docker run -dp 3000:3000 test-container-image
      timeout-minutes: 5
    - run: docker ps
    - name: Wait for Service to start
      run: while ! curl -s localhost:3000/health; do sleep 1; done
      timeout-minutes: 1
    - name: Check API health
      run: curl -s localhost:3000/health