diff --git a/.github/workflows/main_pipeline.yml b/.github/workflows/main_pipeline.yml index 0090ff5..53ae637 100644 --- a/.github/workflows/main_pipeline.yml +++ b/.github/workflows/main_pipeline.yml @@ -7,6 +7,15 @@ on: branches: ["main", "develop", "feature/**"] jobs: + copilot-review: + if: github.event_name == 'pull_request' + uses: ./.github/workflows/mr.yml + permissions: + contents: read + pull-requests: write + issues: write + secrets: inherit + build-task: uses: ./.github/workflows/build.yml secrets: inherit diff --git a/.github/workflows/mr.yml b/.github/workflows/mr.yml new file mode 100644 index 0000000..0c95d35 --- /dev/null +++ b/.github/workflows/mr.yml @@ -0,0 +1,26 @@ +name: call copilot on merge requests + +on: + workflow_call: + +jobs: + copilot-review: + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + issues: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: GitHub Copilot Code Review + uses: github/copilot-codereviewer@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + review-level: 'detailed' + include-files: '**/*.py,**/*.js,**/*.ts,**/*.jsx,**/*.tsx,**/*.yml,**/*.yaml,**/*.json,**/*.md' + exclude-files: '**/node_modules/**,**/dist/**,**/__pycache__/**,**/build/**' + enable-suggestions: true \ No newline at end of file diff --git a/.github/workflows/promote.yml b/.github/workflows/promote.yml index 822d06c..9c89c16 100644 --- a/.github/workflows/promote.yml +++ b/.github/workflows/promote.yml @@ -25,49 +25,49 @@ jobs: docker build -t ghcr.io/mathieuaudibert/conteneurisation-orchestration:latest . docker push ghcr.io/mathieuaudibert/conteneurisation-orchestration:latest - deploy-to-k8s: - runs-on: ubuntu-latest - needs: [publish-images] - steps: - - name: Checkout code - uses: actions/checkout@v4 + #deploy-to-k8s: + #runs-on: ubuntu-latest + #needs: [publish-images] + #steps: + #- name: Checkout code + # uses: actions/checkout@v4 - - name: Configure kubectl - uses: azure/k8s-set-context@v3 - with: - method: kubeconfig - kubeconfig: ${{ secrets.KUBECONFIG }} + #- name: Configure kubectl + # uses: azure/k8s-set-context@v3 + # with: + # method: kubeconfig + # kubeconfig: ${{ secrets.KUBECONFIG }} - - name: Create secrets from environment - run: | - kubectl create secret generic mongodb-secret \ - --from-literal=username=${{ secrets.MONGO_ADM_USER }} \ - --from-literal=password=${{ secrets.MONGO_ADM_PASSWD }} \ - --from-literal=admin-uri=${{ secrets.ADM_MONGO_URI }} \ - --dry-run=client -o yaml | kubectl apply -f - + #- name: Create secrets from environment + # run: | + # kubectl create secret generic mongodb-secret \ + # --from-literal=username=${{ secrets.MONGO_ADM_USER }} \ + # --from-literal=password=${{ secrets.MONGO_ADM_PASSWD }} \ + # --from-literal=admin-uri=${{ secrets.ADM_MONGO_URI }} \ + # --dry-run=client -o yaml | kubectl apply -f - - - name: Deploy MongoDB - run: kubectl apply -f k8s/mongoDB.yml + #- name: Deploy MongoDB + # run: kubectl apply -f k8s/mongoDB.yml - - name: Deploy Backend - run: | - kubectl apply -f k8s/backend.yml - kubectl rollout restart deployment/backend - kubectl rollout status deployment/backend --timeout=5m + #- name: Deploy Backend + # run: | + # kubectl apply -f k8s/backend.yml + # kubectl rollout restart deployment/backend + # kubectl rollout status deployment/backend --timeout=5m - - name: Deploy Frontend - run: | - kubectl apply -f k8s/frontend.yml - kubectl rollout restart deployment/frontend - kubectl rollout status deployment/frontend --timeout=5m + #- name: Deploy Frontend + # run: | + # kubectl apply -f k8s/frontend.yml + # kubectl rollout restart deployment/frontend + # kubectl rollout status deployment/frontend --timeout=5m - - name: Deploy Documentation - run: | - kubectl apply -f k8s/documentation.yml - kubectl rollout restart deployment/documentation - kubectl rollout status deployment/documentation --timeout=5m + #- name: Deploy Documentation + # run: | + # kubectl apply -f k8s/documentation.yml + # kubectl rollout restart deployment/documentation + # kubectl rollout status deployment/documentation --timeout=5m - - name: Verify deployment - run: | - kubectl get pods - kubectl get services \ No newline at end of file + #- name: Verify deployment + # run: | + # kubectl get pods + # kubectl get services \ No newline at end of file