Skip to content

Commit

Permalink
chore(workflow): update deployement workflow. (#14)
Browse files Browse the repository at this point in the history
* modified:   .gitignore

* chore: update workflow.

* fix: flake8 error.

* fix: last mistake
  • Loading branch information
Angel-Dijoux authored Nov 2, 2023
1 parent ebe52be commit 9f748b6
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
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

0 comments on commit 9f748b6

Please sign in to comment.