diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f81fce0e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,45 @@ +name: ci + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: '3.x' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: run + run: | + python -m http.server 8000 & + sleep 5 + curl -I http://localhost:8000/index.html + + - name: Set up Git for deployment + run: | + git config --global user.name 'GitHub Actions' + git config --global user.email 'actions@github.com' + + - name: deploy + run: | + git checkout -b projeto_deploy || git checkout projeto_deploy + git add . + git commit -m "Deploy changes to projeto_deploy branch" + git push origin projeto_deploy + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/requirements.txt b/requirements.txt index a3b33beb..ff424606 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ fastapi==0.112.0 uvicorn==0.30.5 -requests==2.32.3 \ No newline at end of file +requests==2.32.3 +pytest==8.3.2 \ No newline at end of file