name: CI — Tests & Docker Build on: push: paths: - 'Olhar-PWA/**' branches: - main - 'feat/**' pull_request: paths: - 'Olhar-PWA/**' defaults: run: working-directory: Olhar-PWA jobs: test: name: Tests & couverture runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v4 - name: Build image de test run: docker build -f Dockerfile.test -t olhar-pwa-test:ci . - name: Lancer les tests run: docker run --rm --security-opt seccomp=unconfined olhar-pwa-test:ci build-and-push: name: Build & push image Docker needs: test runs-on: ubuntu-latest if: github.ref == 'refs/heads/main' steps: - name: Checkout uses: actions/checkout@v4 - name: Lire la version depuis package.json id: version run: echo "VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT - name: Login registry Gitea uses: docker/login-action@v3 with: registry: git.goutailler-olivier.com username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_TOKEN }} - name: Build & push image uses: docker/build-push-action@v5 with: context: Olhar-PWA file: Olhar-PWA/Dockerfile push: true tags: | git.goutailler-olivier.com/gato/olhar-pwa:latest git.goutailler-olivier.com/gato/olhar-pwa:${{ steps.version.outputs.VERSION }}