diff --git a/.github/workflows/azure-container-webapp.yml b/.github/workflows/azure-container-webapp.yml new file mode 100644 index 0000000..caa1cd5 --- /dev/null +++ b/.github/workflows/azure-container-webapp.yml @@ -0,0 +1,33 @@ +name: CI Pipeline + +on: + push: + branches: [main] + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.12' + + - name: Install Dependencies + run: | + pip3 install -r requirements.txt + + - name: Run tests with pytest + run: | + pip3 install pytest + + + - name: Build and push Docker image + run: | + docker build -t ${{secrets.LOGIN_SERVER}}/flask-app:latest . + docker login ${{secrets.LOGIN_SERVER}} -u ${{secrets.AZURE_USERNAME}} -p ${{secrets.AZURE_PASSWORD}} + docker push ${{secrets.LOGIN_SERVER}}/flask-app:latest diff --git a/Dockerfile b/Dockerfile index fcc1935..d55b1b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,6 +10,6 @@ RUN pip install --no-cache-dir -r requirements.txt ENV RECAPTCHA_PRIVATE_KEY = 6Lfer0kpAAAAAEAtPP1igzvVEtUySFK8UpOCN57X -EXPOSE 3000 +EXPOSE 80 CMD ["python", "main.py"] diff --git a/backend/Procfile.dev b/backend/Procfile.dev index 211eaa3..33d52c4 100644 --- a/backend/Procfile.dev +++ b/backend/Procfile.dev @@ -1,4 +1,4 @@ # Procfile.dev - development # Use the Flask development server. -web: python app.py +web: python main.py