Skip to content

fix

fix #46

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
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 HTTP server and verify
run: |
python -m http.server 8000 &
# Give the server time to start
for i in {1..10}; do
if curl -s http://localhost:8000/index.html > /dev/null; then
echo "Server is up and running."
break
else
echo "Waiting for server to start..."
sleep 1
fi
done
# Fetch the page
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 '[email protected]'
- name: Fetch and Checkout Branch
run: |
git fetch origin
git checkout projeto_deploy || echo "Branch projeto_deploy does not exist locally; creating it."
git pull origin projeto_deploy || echo "Failed to pull from projeto_deploy."
- name: Commit and Push Changes
run: |
git add .
git commit -m "Deploy changes to projeto_deploy branch" || echo "No changes to commit"
git push origin projeto_deploy || echo "Failed to push changes to projeto_deploy."
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}