Skip to content

Commit

Permalink
Reenabling the test workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
flokapi committed Sep 17, 2024
1 parent c534fdc commit e15519b
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 70 deletions.
134 changes: 65 additions & 69 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,75 +3,74 @@ name: Build and Deploy Code
on: [push, pull_request]

jobs:
# test:
# environment:
# name: testing
# env:
# TF_MODEL_EPOCHS: ${{vars.TF_MODEL_EPOCHS}}
# IMAGE_SIZE_X: ${{vars.IMAGE_SIZE_X}}
# IMAGE_SIZE_Y: ${{vars.IMAGE_SIZE_Y}}

# # services:
# # postgres:
# # image: postgres
# # env:
# # POSTGRES_PASSWORD: ${{secrets.DATABASE_PASSWORD}}
# # POSTGRES_DB: ${{secrets.DATABASE_NAME}}_test
# # ports:
# # - 5432:5432
# # options: >-
# # --health-cmd pg_isready
# # --health-interval 10s
# # --health-timeout 5s
# # --health-retries 5

# runs-on: ubuntu-latest
# steps:
# - name: pulling git repo
# uses: actions/checkout@v2
# - name: Install packages
# run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-glx
# - name: Install python version 3.12
# uses: actions/setup-python@v2
# with:
# python-version: "3.12"
# - name: update pip
# run: python -m pip install --upgrade pip

# - name: install
# run: make install
# - name: test
# run: make test


# # - name: Login to Docker Hub
# # uses: docker/login-action@v1
# # with:
# # username: ${{ secrets.DOCKER_HUB_USERNAME }}
# # password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

# # - name: Set up Docker Buildx
# # id: buildx
# # uses: docker/setup-buildx-action@v1

# # - name: Build and push
# # id: docker_build
# # uses: docker/build-push-action@v2
# # with:
# # context: ./
# # file: ./Dockerfile
# # builder: ${{ steps.buildx.outputs.name }}
# # push: true
# # tags: ${{ secrets.DOCKER_HUB_USERNAME }}/fastapi:latest
# # cache-from: type=local,src=/tmp/.buildx-cache
# # cache-to: type=local,dest=/tmp/.buildx-cache
# # - name: Image digest
# # run: echo ${{ steps.docker_build.outputs.digest }}
test:
environment:
name: testing
env:
TF_MODEL_EPOCHS: ${{vars.TF_MODEL_EPOCHS}}
IMAGE_SIZE_X: ${{vars.IMAGE_SIZE_X}}
IMAGE_SIZE_Y: ${{vars.IMAGE_SIZE_Y}}

# services:
# postgres:
# image: postgres
# env:
# POSTGRES_PASSWORD: ${{secrets.DATABASE_PASSWORD}}
# POSTGRES_DB: ${{secrets.DATABASE_NAME}}_test
# ports:
# - 5432:5432
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5

runs-on: ubuntu-latest
steps:
- name: pulling git repo
uses: actions/checkout@v2
- name: Install packages
run: sudo apt-get update && sudo apt-get install -y libgl1-mesa-glx
- name: Install python version 3.12
uses: actions/setup-python@v2
with:
python-version: "3.12"
- name: update pip
run: python -m pip install --upgrade pip
- name: install
run: make install
- name: test
run: make test


# - name: Login to Docker Hub
# uses: docker/login-action@v1
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

# - name: Set up Docker Buildx
# id: buildx
# uses: docker/setup-buildx-action@v1

# - name: Build and push
# id: docker_build
# uses: docker/build-push-action@v2
# with:
# context: ./
# file: ./Dockerfile
# builder: ${{ steps.buildx.outputs.name }}
# push: true
# tags: ${{ secrets.DOCKER_HUB_USERNAME }}/fastapi:latest
# cache-from: type=local,src=/tmp/.buildx-cache
# cache-to: type=local,dest=/tmp/.buildx-cache
# - name: Image digest
# run: echo ${{ steps.docker_build.outputs.digest }}


deploy:
runs-on: tensorflow/tensorflow:latest
# needs: [test]
runs-on: ubuntu-latest
needs: [test]
environment:
name: production
steps:
Expand All @@ -88,13 +87,10 @@ jobs:
file_name: .env
fail_on_empty: false
sort_keys: false

- name: install
run: make install

- name: build
run: make build

- name: SCP repo to production server
uses: appleboy/scp-action@master
with:
Expand Down
3 changes: 2 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

install:
pip install -r requirements.txt
pip install tensorflow pytest
pip install tensorflow
pip install pytest
npm install tailwindcss


Expand Down

0 comments on commit e15519b

Please sign in to comment.