Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(workflow): update deployement workflow. #14

Merged
merged 4 commits into from
Nov 2, 2023
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
30 changes: 17 additions & 13 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,35 @@
name: Deployment

on:
workflow_call:
push:
branches:
- main
paths-ignore:
- '.github/**'
- '.vscode/**'
- ".github/**"
- ".vscode/**"

env:
MARIADB_ROOT_PASSWORD: ${{ secrets.MARIADB_ROOT_PASSWORD }}
DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
SECRET_KEY: ${{ secrets.SECRET_KEY }}
ONISEP_EMAIL: ${{ secrets.ONISEP_EMAIL }}
ONISEP_PASSWORD: ${{ secrets.ONISEP_PASSWORD }}
ONISEP_APP_ID: ${{ secrets.ONISEP_APP_ID }}

jobs:
build:
runs-on: self-hosted

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Stop running Docker container
run: docker stop api
- name: remove container
run: docker rm api
- name: Remove previous Docker image
run: docker rmi onisep_api-api:latest
- name: Build and Run Docker container
run: docker-compose up -d
- name: Checkout code
uses: actions/checkout@v3
- name: Stop running Docker container
run: docker stop api
- name: remove container
run: docker rm api
- name: Remove previous Docker image
run: docker rmi onisep_api-api:latest
- name: Build and Run Docker container
run: docker-compose up -d
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ __pycache__/
.env

#Ignore db local file
*.db
*.db

# Ignore Bruno directory for now
/Onisep
2 changes: 1 addition & 1 deletion src/blueprints/formations.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Any, Tuple

from flask import Blueprint, Response, request
from flask_jwt_extended import get_jwt_identity, jwt_required
from flask_jwt_extended import jwt_required
from werkzeug.exceptions import HTTPException

from src.blueprints.route_handler import HttpMethod, route_handler
Expand Down
2 changes: 1 addition & 1 deletion src/business_logic/formation/scrap/get_formation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import requests

from src.business_logic.formation import HEADERS, ONISEP_URL
from src.business_logic.formation.scrap.get_onisep_token import get_token
from src.business_logic.formation.scrap.types import (
Facet,
SearchedFormations,
Expand Down
2 changes: 0 additions & 2 deletions src/models/formation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from dataclasses import dataclass
from typing import Optional
import uuid

from sqlalchemy import Text
Expand Down