Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/main_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/mr.yml
Original file line number Diff line number Diff line change
@@ -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
78 changes: 39 additions & 39 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
#- name: Verify deployment
# run: |
# kubectl get pods
# kubectl get services
Loading