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: Update WorkFlow and Jupyter Notebook #47

Merged
merged 2 commits into from
May 20, 2024
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
139 changes: 70 additions & 69 deletions .github/workflows/CI-CD.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,82 +5,82 @@ on:
branches:
- main
paths-ignore:
- '**/README.md'
- '**/CONTRIBUTING.md'
- '**/CODE_OF_CONDUCT.md'
- '.github/**'
- 'docs/**'
- '**/.editorconfig'
- '**/.gitignore'
- '**/LICENSE'
- '**/CREDITS'
- "**/README.md"
- "**/CONTRIBUTING.md"
- "**/CODE_OF_CONDUCT.md"
- ".github/**"
- "docs/**"
- "**/.editorconfig"
- "**/.gitignore"
- "**/LICENSE"
- "**/CREDITS"

workflow_dispatch:

jobs:
test:
if: github.actor != 'actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Gerar o arquivo .env
echo "SERVER_URL=https://economia.awesomeapi.com.br" > .env
- name: Run tests
run: pytest
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# Gerar o arquivo .env
echo "SERVER_URL=https://economia.awesomeapi.com.br" > .env

- name: Run tests
run: pytest

build:
needs: test
if: github.actor != 'actions[bot]'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Build Docker Image using Dockerfile
run: |
docker build -t etl-awesome-api .
- name: Run Docker Image using Dockerfile
run: |
docker run etl-awesome-api

- name: Build Docker Image using Docker Compose
run: |
docker-compose up --build -d

- name: Run Docker image using Docker Compose
run: |
docker run etl-awesome-api-compose

- name: Run Application using Python Native
run: |
python -m venv .venv
source .venv/bin/activate
.venv/bin/python -m pip install --upgrade pip
echo "SERVER_URL=https://economia.awesomeapi.com.br" > .env
pip install -e .
python etl/main.py
- name: Run Application using Poetry
run: |
pip install poetry
poetry install
poetry run python etl/main.py
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}

- name: Build Docker Image using Dockerfile
run: |
docker build -t etl-awesome-api .

- name: Run Docker Image using Dockerfile
run: |
docker run etl-awesome-api

- name: Build Docker Image using Docker Compose
run: |
docker-compose up --build -d

- name: Run Docker image using Docker Compose
run: |
docker run etl-awesome-api-compose

- name: Run Application using Python Native
run: |
python -m venv .venv
source .venv/bin/activate
.venv/bin/python -m pip install --upgrade pip
echo "SERVER_URL=https://economia.awesomeapi.com.br" > .env
pip install -e .
python etl/main.py

- name: Run Application using Poetry
run: |
pip install poetry
poetry install
poetry run python etl/main.py

deploy:
needs: build
if: github.actor != 'actions[bot]'
Expand All @@ -97,20 +97,21 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
python-version: "3.9"

- name: Install Jupyter
run: pip install notebook

- name: Convert notebook to HTML
run: |
jupyter nbconvert --to html notebooks/data_explorer.ipynb --output-dir=views --output=index

jupyter nbconvert --to html notebooks/data_explorer.ipynb --output-dir=docs --output=index
jupyter nbconvert --to html notebooks/data_explorer.ipynb --output-dir=etl/views --output=index

- name: Setup Git
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'

- name: Commit and Push Notebook
run: |
git add .
Expand All @@ -119,4 +120,4 @@ jobs:
else
git commit -m "Add generated HTML to README"
git push
fi
fi
Loading