From 88db16c75271ee93c05ee96f643fdda01d842614 Mon Sep 17 00:00:00 2001 From: Ereiarrus Date: Wed, 31 Jan 2024 01:13:05 +0000 Subject: [PATCH] removing custom action - doing everything for it in container --- .github/actions/python-init/action.yml | 25 ------------------------- .github/workflows/python-app.yml | 6 +++--- Dockerfile | 8 -------- docker_run.sh | 10 ++-------- 4 files changed, 5 insertions(+), 44 deletions(-) delete mode 100644 .github/actions/python-init/action.yml diff --git a/.github/actions/python-init/action.yml b/.github/actions/python-init/action.yml deleted file mode 100644 index e96e0a3..0000000 --- a/.github/actions/python-init/action.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: python-env-init -description: Initialises a Python environment - - -inputs: - secrets: - required: true - description: a JSON object of all GitHub secrets - -runs: - using: 'composite' - steps: - - uses: oNaiPs/secrets-to-env-action@v1 # exports all github secrets as env variables (when used with the next 2 lines) - with: - secrets: ${{ inputs.secrets }} - -# - name: Set up Python 3.12 -# uses: actions/setup-python@v3 -# with: -# python-version: "3.12" -# - name: Install dependencies -# run: | -# python -m pip install --upgrade pip -# if [ -f src/requirements.txt ]; then pip install -r src/requirements.txt; fi -# shell: bash diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index adc8e15..0c87395 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -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) }} @@ -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) }} @@ -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) }} diff --git a/Dockerfile b/Dockerfile index a1b3009..d3ff183 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,14 +18,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"] diff --git a/docker_run.sh b/docker_run.sh index 0ead5ae..3bf21cf 100644 --- a/docker_run.sh +++ b/docker_run.sh @@ -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 @@ -21,7 +15,7 @@ if [ -z "$old_container_id" ]; then fi else restarter="$(pgrep restart_24.sh)" - kill "$restarter" + kill "$restarter" || true docker stop "$old_container_id" > /dev/null 2>&1 fi @@ -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 &