Skip to content

update: tech stack

update: tech stack #1

name: Build & deploy application to Render
on:
push:
branches:
- main
paths:
- "backend/**"
permissions:
contents: write
deployments: write
jobs:
test:
runs-on: ubuntu-latest
name: Test
env:
TSKZ_HTTP_API_KEY: ${{ secrets.TSKZ_HTTP_API_KEY }}
defaults:
run:
working-directory: backend
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Upgrade Pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Run tests
run: pytest
docker-deploy:
name: Build and Push Docker Image
runs-on: ubuntu-latest
needs: test
environment:
name: docker_hub
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image to Docker Hub
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: "{{defaultContext}}:backend"
file: Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/taskaza-api:${{ github.sha }}
cache-from: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/taskaza-api:buildcache
cache-to: type=registry,ref=${{ secrets.DOCKER_HUB_USERNAME }}/taskaza-api:buildcache,mode=max
deploy-to-render:
name: Deploy to Render
runs-on: ubuntu-latest
needs: test
environment:
name: render
steps:
- name: Deploy to Render
uses: JorgeLNJunior/[email protected]
with:
service_id: ${{ secrets.RENDER_SERVICE_ID }}
api_key: ${{ secrets.RENDER_API_KEY }}
github_deployment: true
deployment_environment: 'render'
github_token: ${{ secrets.GITHUB_TOKEN }}