Skip to content

fix(ci/cd): resouce type #2

fix(ci/cd): resouce type

fix(ci/cd): resouce type #2

Workflow file for this run

name: Academy Master Tests
on:
push:
branches: [main]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Docker
uses: docker/setup-buildx-action@v2
- name: Build The Image
run: make build
test-on-docker:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: SetUp Docker
uses: docker/setup-buildx-action@v2
- name: Build the image
run: make build
- name: Run Containers
run: make run DETACHED=true
- name: Wait for backend container to prepare
uses: jakejarvis/wait-action@master
with:
time: '5s'
- name: Run tests
run: make test
test-on-kubernetes:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up kubectl
uses: azure/setup-kubectl@v1
- name: Start minikube
uses: medyagh/setup-minikube@master
- name: Create ConfigMap
run: kubectl create configmap academy-master-env --from-env-file=./backend/.env.local && kubectl create configmap academy-master-env-file --from-file=.env=./backend/.env.local
- name: Run Kubernetes Deployments
run: kubectl apply -f kubernetes/
- name: Wait for Database Deployments
run: kubectl wait --for=condition=available --timeout=60s deployment/academy-master-postgres-dp
- name: Wait for Redis Service
run: kubectl wait --for=condition=available --timeout=60s deployment/academy-master-redis-dp
- name: Wait for Backend Deployments
run: kubectl wait --for=condition=available --timeout=60s deployment/academy-master-backend-dp
- name: Run Backend Tests
run: kubectl exec -it $(kubectl get pods | grep backend | awk '{print $1}') -- pytest
deploy:
needs: [ test-on-docker, test-on-kubernetes ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Fake Deployment
run: echo "Deploying the service to the cloud..."