Skip to content

Commit

Permalink
removing custom action - doing everything for it in container
Browse files Browse the repository at this point in the history
  • Loading branch information
Ereiarrus committed Jan 31, 2024
1 parent 8052038 commit b99496c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 43 deletions.
25 changes: 0 additions & 25 deletions .github/actions/python-init/action.yml

This file was deleted.

7 changes: 4 additions & 3 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/python-init
- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}

Expand Down Expand Up @@ -42,7 +42,7 @@ jobs:
needs: [build]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/python-init
- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}

Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
if: github.ref == 'refs/heads/main' # Only deploy if this was a push to main
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/python-init
- uses: oNaiPs/secrets-to-env-action@v1
with:
secrets: ${{ toJSON(secrets) }}

Expand Down Expand Up @@ -101,4 +101,5 @@ jobs:
chmod +x ./docker_build.sh
chmod +x ./docker_run.sh
chmod +x ./restart_24.sh
./docker_run.sh
9 changes: 1 addition & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ENV PYTHONPATH /complements-bot-py
COPY src ./src
COPY main.py .
RUN rm -rf ./src/test_complements_bot
RUN rm -rf ./src/test_app
RUN pip install pipenv
RUN apk update
RUN apk add gcc
Expand All @@ -18,14 +19,6 @@ RUN apk add build-base
RUN cd ./src; pipenv install --system --deploy; cd ..
RUN rm -rf /var/cache/apk/*
RUN pip install cython

RUN find /usr -name Python.h

RUN python3-config --includes
RUN python3-config --includes | grep python3.12

RUN python -m cython -3 --embed -o main.c main.py
RUN gcc -Os -I $(python3-config --includes | grep python3.12) -o main main.c -lpython3.12 -lpthread -lutil $(python3-config --libs)
# EXPOSE 50994/tcp
# EXPOSE 50995/tcp
CMD ["./main"]
8 changes: 1 addition & 7 deletions docker_run.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#!/bin/bash


#restarter_kill_status="$?"
#if [ "$restarter_kill_status" != 0 ]; then
# >&2 echo "error on killing restarter script"
# exit "$restarter_kill_status"
#fi

old_container_id="$(./docker_build.sh)"
build_status="$?"
if [ "$build_status" != 0 ]; then
Expand Down Expand Up @@ -38,4 +32,4 @@ if [ "$run_status" != 0 ]; then
exit "$run_status"
fi

nohup ./restart_24.sh "$container_id" 1>&2 2>/restart.log &
nohup ./restart_24.sh "$container_id" 1>&2 2>./restart.log &

0 comments on commit b99496c

Please sign in to comment.