Spaces:
Sleeping
Sleeping
Commit ·
821a97d
1
Parent(s): b4f32e7
add CI/CD pipeline
Browse files12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970name: CI/CD Pipeline
on: push: branches: - master
jobs: test: runs-on: ubuntu-latest
services: postgres: image: postgres:15 env: POSTGRES_USER: postgres POSTGRES_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} POSTGRES_DB: job_tracker_test ports: - 5432:5432 options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
env: DATABASE_HOSTNAME: localhost DATABASE_PORT: 5432 DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }} DATABASE_NAME: job_tracker_test DATABASE_USERNAME: postgres SECRET_KEY: ${{ secrets.SECRET_KEY }} ALGORITHM: HS256 ACCESS_TOKEN_EXPIRE_MINUTES: 30 GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
steps: - name: Checkout code uses: actions/checkout@v3
- name: Set up Python uses: actions/setup-python@v4 with: python-version: "3.11"
- name: Install dependencies run: pip install -r requirements.txt
- name: Run tests run: pytest --disable-warnings -v
deploy: runs-on: ubuntu-latest needs: test
steps: - name: Checkout code uses: actions/checkout@v3 with: fetch-depth: 0 lfs: true
- name: Push to Hugging Face env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git config --global user.email "ci@github.com" git config --global user.name "GitHub Actions" git push https://abdullah090809:$HF_TOKEN@huggingface.co/spaces/abdullah090809/Job_Tracker_API master:main --force.github/workflows/ci-cd.ymlAdded+70