From ebd62acf5ebc11bb3e706d0629d05f7899b8f254 Mon Sep 17 00:00:00 2001 From: Vini47 Date: Tue, 3 Sep 2024 18:06:56 -0300 Subject: [PATCH] pipeline --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++++++++++++++ requirements.txt | 3 ++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..f81fce0e9 --- /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 a3b33beb7..ff4246060 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