Skip to content

feat: no limit

feat: no limit #179

Workflow file for this run

name: Build, deploy, test
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build and test
timeout-minutes: 10
run: |
echo ${{ github.sha }} > commit.txt
docker build -t ai-ml-web:latest -f ./Dockerfile-web .
docker swarm init
docker stack deploy ai-ml -c docker-compose.yml --prune
sleep 15
until [ $(docker inspect -f "{{json .State.Status }}" $(docker ps -a --filter ancestor=ai-ml-web --format="{{.ID}}" | head -n 1)) == '"running"' ]; do echo "Waiting for container to start..." && sleep 1; done
docker container exec -i $(docker ps -f name=ai-ml_web --format "{{.ID}}") pytest web
docker container exec -i $(docker ps -f name=ai-ml_web --format "{{.ID}}") ruff check web/
- uses: superfly/flyctl-actions/setup-flyctl@master
if: ${{ github.ref == 'refs/heads/main' }}
- name: Deploy to fly.io
timeout-minutes: 10
if: ${{ github.ref == 'refs/heads/main' }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_ACCESS_TOKEN }}
run: flyctl deploy --local-only --wait-timeout=600 -i ai-ml-web:latest