NicolasW-7 / AIS-Brief-et-TIPS

4 stars 0 forks source link

Les tests de build doivent se faire automatiquement lors du push sur GitHub #15

Closed Zennael closed 3 months ago

Ariyu-M commented 3 months ago

Contenu du CI :

 name: Docker Build and Test

on:
  push:
    branches:
      - main  # À ajuster selon votre branche principale
  pull_request:
    branches:
      - main  # À ajuster selon votre branche principale

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout code
      uses: actions/checkout@v2

    - name: Build Docker image
      run: docker build -t myapp .

    - name: Run container
      run: docker run -d --name myapp -p 3000:3000 myapp

    - name: Check if container is running
      run: docker ps | grep myapp

    - name: Test application
      run: |
        sleep 10  # Wait a bit for the application to start
        curl --insecure https://0.0.0.0:3000 -vvv

    - name: Stop and remove the container
      run: docker stop myapp && docker rm myapp 
Zennael commented 3 months ago

finish