Compare commits

..
9 Commits
Author SHA1 Message Date
renovate[bot] a912c50b88 chore(deps): update rust crate tokio to v1.54.1
CI / Test and publish (pull_request) Successful in 2m41s
CI / Deploy published image to production (pull_request) Skipped
CI / Test and publish (push) Successful in 32s
CI / Deploy published image to production (push) Successful in 31s
2026-10-22 00:09:24 +00:00
renovate[bot] 9137cf2d92 chore(deps): update rust to v1.99.1
CI / Test and publish (pull_request) Successful in 5m40s
CI / Deploy published image to production (pull_request) Skipped
CI / Test and publish (push) Successful in 32s
CI / Deploy published image to production (push) Successful in 26s
2026-10-17 00:07:19 +00:00
renovate[bot] d14629e6a6 chore(deps): update rust crate icalendar to v0.17.15
CI / Test and publish (pull_request) Successful in 1m13s
CI / Deploy published image to production (pull_request) Skipped
CI / Test and publish (push) Successful in 21s
CI / Deploy published image to production (push) Successful in 22s
2026-10-15 00:31:03 +00:00
Valentin Popov 124a207968 ci: publish only latest and release image tags
CI / Test and publish (push) Successful in 26s
CI / Deploy published image to production (push) Successful in 17s
2026-10-15 03:42:58 +04:00
Valentin Popov bec233ede8 refactor(ci): simplify deployment to a single SSH session
CI / Test and publish (push) Successful in 20s
CI / Deploy published image to production (push) Successful in 11s
2026-10-15 03:42:37 +04:00
Valentin Popov 69ca30ae6b fix(ci): reuse SSH connection and delay service restart
CI / Test and publish (push) Successful in 21s
CI / Deploy published image to production (push) Successful in 16s
2026-10-15 03:39:40 +04:00
Valentin Popov 7663ef111f Merge pull request 'chore(deps): update non-major dependencies' (!4) from renovate/non-major-dependencies into master
CI / Test and publish (push) Successful in 28s
CI / Deploy published image to production (push) Failing after 41s
Reviewed-on: #4
2026-10-15 03:31:15 +04:00
Valentin Popov 56111291c7 ci(deploy): deploy published images via SSH and Docker Compose
CI / Test and publish (push) Successful in 23s
CI / Deploy published image to production (push) Successful in 19s
2026-10-15 03:23:55 +04:00
renovate[bot] 63ff1049dd chore(deps): update non-major dependencies
CI / Test and publish (pull_request) Successful in 2m3s
2026-10-14 00:07:22 +00:00
6 changed files with 73 additions and 13 deletions

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
API_URL=https://api.vacationplanner.ru
UPSTREAM_TIMEOUT_SECONDS=15
HTTP_PORT=8080
+57 -1
View File
@@ -9,7 +9,7 @@ on:
concurrency:
group: ci-${{ gitea.ref }}
cancel-in-progress: true
cancel-in-progress: false
permissions:
contents: read
@@ -19,6 +19,8 @@ jobs:
name: Test and publish
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
image: ${{ steps.publish.outputs.image }}
env:
IMAGE: code.popov.link/valentineus/vacationplanner2ics
TEST_IMAGE: vacationplanner2ics-test:ci-${{ gitea.run_id }}
@@ -75,6 +77,7 @@ jobs:
test "$(docker inspect --format '{{.State.ExitCode}}' "$SMOKE_CONTAINER")" = 0
- name: Publish to Gitea Container Registry
id: publish
if: >-
gitea.event_name != 'pull_request' &&
(gitea.ref == 'refs/heads/master' || startsWith(gitea.ref, 'refs/tags/v'))
@@ -97,9 +100,62 @@ jobs:
fi
docker tag "$RUNTIME_IMAGE" "$IMAGE:$TAG"
docker push "$IMAGE:$TAG"
printf 'image=%s:%s\n' "$IMAGE" "$TAG" >> "$GITHUB_OUTPUT"
- name: Remove temporary containers and image tags
if: always()
run: |
docker rm -f "$SMOKE_CONTAINER" 2>/dev/null || true
docker image rm "$TEST_IMAGE" "$RUNTIME_IMAGE" 2>/dev/null || true
deploy-server:
name: Deploy published image to production
needs: ci
if: >-
gitea.ref == 'refs/heads/master' &&
(gitea.event_name == 'push' || gitea.event_name == 'workflow_dispatch')
runs-on: ubuntu-latest
timeout-minutes: 10
env:
IMAGE: ${{ needs.ci.outputs.image }}
DEPLOY_SSH_HOST: ${{ secrets.DEPLOY_SSH_HOST }}
DEPLOY_SSH_PORT: ${{ secrets.DEPLOY_SSH_PORT }}
DEPLOY_SSH_USER: ${{ secrets.DEPLOY_SSH_USER }}
DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }}
DEPLOY_SSH_PRIVATE_KEY_BASE64: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY_BASE64 }}
DEPLOY_SSH_KNOWN_HOSTS: ${{ secrets.DEPLOY_SSH_KNOWN_HOSTS }}
steps:
- name: Checkout deployment files
uses: actions/checkout@v7
with:
persist-credentials: false
- name: Deploy and check readiness
shell: bash
run: |
set -Eeuo pipefail
umask 077
ssh_directory="$(mktemp -d)"
trap 'rm -rf "$ssh_directory"' EXIT
printf '%s' "$DEPLOY_SSH_PRIVATE_KEY_BASE64" | base64 --decode > "$ssh_directory/key"
printf '%s\n' "$DEPLOY_SSH_KNOWN_HOSTS" > "$ssh_directory/known_hosts"
ssh -i "$ssh_directory/key" -p "$DEPLOY_SSH_PORT" \
-o UserKnownHostsFile="$ssh_directory/known_hosts" \
-o StrictHostKeyChecking=yes -o BatchMode=yes -o IdentitiesOnly=yes \
-o ConnectTimeout=15 -o ConnectionAttempts=3 \
-o ServerAliveInterval=15 -o ServerAliveCountMax=3 \
"$DEPLOY_SSH_USER@$DEPLOY_SSH_HOST" "
set -eu
cd '$DEPLOY_PATH'
cat > compose.yaml
export IMAGE='$IMAGE'
docker compose pull app
sed -i '/^IMAGE=/d' .env
printf '\\nIMAGE=%s\\n' '$IMAGE' >> .env
docker compose up --pull never --detach --force-recreate app
bind_addr=\$(docker inspect --format '{{range .Config.Env}}{{println .}}{{end}}' \"\$(docker compose ps --quiet app)\" | sed -n 's/^BIND_ADDR=//p')
curl --fail --silent --show-error --retry 15 --retry-all-errors \
--retry-delay 2 --max-time 3 \"http://\$bind_addr/healthz\" | grep -qx ok
" < compose.yaml
Generated
+4 -4
View File
@@ -456,9 +456,9 @@ dependencies = [
[[package]]
name = "icalendar"
version = "0.17.14"
version = "0.17.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "785af055d3fda0cd975e77b358d8e5d20dd7dbcca6a61eefd197410b8a1cbfe7"
checksum = "ef7e7ae829dee4463f049b1f2855a7b0ba7a255bef3c06a09ca22a7befa4e9e4"
dependencies = [
"chrono",
"iso8601",
@@ -1296,9 +1296,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.53.2"
version = "1.54.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e95f91fcc7a621e8b030f6aa23c71fe9838ae2fb4d8118b75602a328f5144044"
checksum = "b52fd3255258d26fac7264ab5a76b53c13367136dc011d3d6ad4f8ed070396a3"
dependencies = [
"bytes",
"libc",
+1 -1
View File
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
FROM rust:1.99.0-alpine3.22 AS build
FROM rust:1.99.1-alpine3.22 AS build
RUN apk add --no-cache cmake make
WORKDIR /build
ARG TARGETARCH
+7 -6
View File
@@ -1,13 +1,14 @@
name: vacationplanner2ics
services:
app:
build:
context: .
target: runtime
image: ${IMAGE:-code.popov.link/valentineus/vacationplanner2ics:latest}
pull_policy: always
network_mode: host
environment:
BIND_ADDR: 127.0.0.1:${HTTP_PORT:-8080}
API_URL: ${API_URL:-https://api.vacationplanner.ru}
UPSTREAM_TIMEOUT_SECONDS: ${UPSTREAM_TIMEOUT_SECONDS:-15}
ports:
- "127.0.0.1:8080:8080"
restart: unless-stopped
read_only: true
cap_drop: [ALL]
@@ -16,7 +17,7 @@ services:
dev:
profiles: [dev]
image: rust:1.99.0-bookworm
image: rust:1.99.1-bookworm
working_dir: /workspace
command: sleep infinity
init: true
+1 -1
View File
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.99.0"
channel = "1.99.1"
profile = "minimal"
components = ["clippy", "rustfmt"]