Compare commits

...

13 Commits

Author SHA1 Message Date
013c9c5a15 fix prod v1
All checks were successful
Deploy to Production / deploy (push) Successful in 3s
2025-07-30 14:25:48 +03:00
b3e1a5c88c Merge branch 'main' into prod
Some checks failed
Deploy to Production / deploy (push) Failing after 1s
2025-07-30 14:12:05 +03:00
f7ed20de0e Merge branch 'main' into prod
Some checks failed
Deploy to Production / deploy (push) Failing after 3s
v1.0.0 release
2025-07-26 21:39:56 +03:00
995b539a67 ver 14.1
Some checks failed
Deploy to Production / deploy (push) Failing after 2s
2025-07-25 04:33:15 +03:00
2515294c56 ver 14
Some checks failed
Deploy to Production / deploy (push) Failing after 2s
2025-07-25 04:32:34 +03:00
88d43124f7 v7
All checks were successful
Deploy to Production / deploy (push) Successful in 29s
2025-07-25 03:47:26 +03:00
56db68768b v6
Some checks failed
Deploy to Production / deploy (push) Failing after 3s
2025-07-25 03:44:02 +03:00
b9e248c02e 11
Some checks failed
Deploy to Production / deploy (push) Failing after 1s
2025-07-25 03:26:30 +03:00
a73c714d88 fix d v5
Some checks failed
Deploy to Production / deploy (push) Failing after 1s
2025-07-25 03:24:02 +03:00
25e53aa84e fix deployment v4
Some checks failed
Deploy to Production / deploy (push) Failing after 1s
2025-07-25 03:20:37 +03:00
ae0290145a fix deployment v3
Some checks failed
Deploy to Production / deploy (push) Has been cancelled
2025-07-25 03:17:52 +03:00
d21b3b3214 fix deployment v2
Some checks failed
Deploy to Production / deploy (push) Failing after 0s
2025-07-25 03:16:25 +03:00
008b2e57f2 test deploy
Some checks failed
Deploy to Production / deploy (push) Failing after 9s
2025-07-25 03:08:24 +03:00

View File

@@ -7,37 +7,53 @@ on:
jobs:
deploy:
runs-on: [docker:host]
runs-on: [docker, host]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Prepare workspace
run: |
rm -rf /tmp/olaper || true
mkdir -p /tmp/olaper
cd /tmp/olaper
apk update && apk add openssh docker-cli
mkdir -p ~/.ssh
chmod 700 ~/.ssh
ssh-keyscan -p 2222 10.25.100.250 >> ~/.ssh/known_hosts
git clone --branch prod ssh://git@10.25.100.250:2222/serty/olaper.git .
- name: Build Docker image
run: |
cd /tmp/olaper
docker build -t olaper:latest .
- name: Stop old container (if running)
- name: Create volume (if not exists)
run: |
if [ "$(docker ps -q -f name=olaper)" ]; then
docker stop olaper && docker rm olaper
docker volume create olaper_data || true
- name: Stop and remove old containers
run: |
# Stop and remove container named olaper if exists
docker stop olaper || true
docker rm olaper || true
# Stop and remove any container using port 5005
PORT=5005
CONTAINER_IDS=$(docker ps -q --filter "publish=$PORT")
if [ -n "$CONTAINER_IDS" ]; then
echo "Stopping containers using port $PORT..."
docker stop $CONTAINER_IDS
docker rm $CONTAINER_IDS
fi
- name: Run new container
run: |
PORT=5005
CONTAINER_ID=$(docker ps --format '{{.ID}} {{.Ports}}' | grep ":$PORT->" | awk '{print $1}')
if [ -n "$CONTAINER_ID" ]; then
echo "Stopping container using port $PORT..."
docker stop "$CONTAINER_ID"
docker rm "$CONTAINER_ID"
fi
docker run -d \
--name olaper \
--restart always \
-p ${PORT}:5005 \
-p 5005:5005 \
-e SECRET_KEY=${{ secrets.SECRET_KEY }} \
-e ENCRYPTION_KEY=${{ secrets.ENCRYPTION_KEY }} \
-v mholaper_data:/app/data \
-v olaper_data:/opt/olaper/data \
olaper:latest
- name: Cleanup
run: rm -rf /tmp/olaper || true