{"id":504205,"date":"2026-11-21T10:01:24","date_gmt":"2026-11-21T07:01:24","guid":{"rendered":"https:\/\/savepearlharbor.com\/?p=504205"},"modified":"2026-11-21T10:01:24","modified_gmt":"2026-11-21T07:01:24","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=504205","title":{"rendered":"\u041d\u0435\u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0434\u0435\u043f\u043b\u043e\u0439, \u0438\u043b\u0438 \u043a\u0430\u043a \u043f\u043e\u0434\u043b\u043e\u0436\u0438\u0442\u044c \u0441\u0432\u0438\u043d\u044c\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c"},"content":{"rendered":"<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435: \u0434\u0435\u043f\u043b\u043e\u0439 \u043f\u0440\u043e\u0448\u0451\u043b, \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0437\u0435\u043b\u0451\u043d\u044b\u0439. \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e \u2014 \u044d\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u0432 \u043b\u043e\u0433\u0430\u0445. \u041d\u043e \u043d\u0430 \u043f\u0440\u043e\u0434\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0435\u0442. \u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0437\u0430\u0434\u0430\u044e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d \u043a\u0430\u043a \u0440\u0430\u0437 \u043b\u043e\u0432\u0438\u0442 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0438\u0439 \u0431\u0430\u0433.<\/p>\n<p>\u041d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u043e \u043d\u0435 \u0432 \u0431\u0430\u0433\u0435. \u041a\u043e\u0434 \u043c\u043e\u0433 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<p>\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043e\u0434\u043d\u043e\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 Docker Compose, \u0431\u0435\u0437 blue-green \u0438 \u0431\u0435\u0437 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0440\u044b\u0432\u0430. \u0417\u0434\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u043d\u0435 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u043a\u043b\u0430\u0434\u043a\u0438, \u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434.<\/p>\n<h3>\u041a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438<\/h3>\n<p>GitHub Actions \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u043b Docker-\u043e\u0431\u0440\u0430\u0437 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0435\u0433\u043e \u0432 GHCR. \u041d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0434\u0435\u043f\u043b\u043e\u044f VPS \u043d\u0435 \u0441\u043c\u043e\u0433 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437:<\/p>\n<pre><code>err: Error response from daemon: Head\"https:\/\/ghcr.io\/v2\/example\/app\/manifests\/latest\": denied: denied<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper\"><\/span><\/a><\/div><\/pre>\n<p>\u042d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u043a\u0430\u043a \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f. \u041d\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0448\u0430\u0433\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0437\u0435\u043b\u0451\u043d\u0430\u044f \u0433\u0430\u043b\u043e\u0447\u043a\u0430:<\/p>\n<pre><code>\u2705 Successfully executed commands to all host.<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>Workflow \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u043a VPS \u043f\u043e SSH \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0442\u0430\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0421\u0430\u043c\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u041e\u0448\u0438\u0431\u043a\u043e\u0439 \u0431\u044b\u043b <code>docker pull<\/code>, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0439\u0441\u044f <code>appleboy\/ssh-action@v0.1.10<\/code> \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0451: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>script\\_stop<\/code> \u0431\u044b\u043b \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code class=\"bash\">docker compose downdocker compose up -d<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u0436\u0435 \u043b\u0435\u0436\u0430\u043b \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043e\u0431\u0440\u0430\u0437. \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043b\u0438\u0441\u044c \u0438\u0437 \u043d\u0435\u0433\u043e, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 SSH Action \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u043e\u0431 \u0443\u0441\u043f\u0435\u0445\u0435, \u0445\u043e\u0442\u044f \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0435 \u0434\u043e\u0435\u0445\u0430\u043b.<\/p>\n<p>\u042d\u0442\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 SSH-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f. SSH \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442: GitHub Actions \u043f\u0435\u0440\u0435\u0434\u0430\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0430 Action \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0412 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0448\u0430\u0433\u0430 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442, \u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0437\u0435\u043b\u0451\u043d\u043e\u043c\u0443 \u0441\u0442\u0430\u0442\u0443\u0441\u0443 \u0432\u0441\u0435\u0433\u043e \u0448\u0430\u0433\u0430.<\/p>\n<h3>\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0449\u0435\u043d<\/h3>\n<p>\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c ID \u043e\u0431\u0440\u0430\u0437\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0441 ID \u043e\u0431\u0440\u0430\u0437\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0435\u0433 <code>latest<\/code>:<\/p>\n<pre><code class=\"bash\">docker inspect app-container \\  --format 'container image={{.Image}}'docker image inspect ghcr.io\/example\/app:latest \\  --format 'local latest image={{.Id}}'<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u0432\u0435\u043b\u0438 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 ID:<\/p>\n<pre><code>container image=sha256:&lt;\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 ID&gt;local latest image=sha256:&lt;\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 ID&gt;<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u042d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0442\u043e\u0442 \u0436\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0442\u0435\u0433 <code>latest<\/code>. \u0421\u0430\u043c\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 ID \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0441\u0442\u0430\u0440\u044b\u0439 \u044d\u0442\u043e \u043a\u043e\u0434 \u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439, \u0438 \u043d\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0441 \u0440\u0435\u0435\u0441\u0442\u0440\u043e\u043c.<\/p>\n<p>\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 Java, \u0442\u043e \u0432\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c JAR \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432 Java-\u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0438\u043c\u0451\u043d \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0418\u043c\u0435\u043d\u0430 \u0438 \u043f\u0443\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435:<\/p>\n<pre><code class=\"bash\">docker cp app-container:\/app\/app.jar \/tmp\/running-app.jarpython3 - &lt;&lt;'PY'from zipfile import ZipFileclass_path = \"BOOT-INF\/classes\/com\/example\/sync\/SyncService.class\"with ZipFile(\"\/tmp\/running-app.jar\") as jar:    bytecode = jar.read(class_path)for name in (\"syncLegacyEntries\", \"syncDateEntries\"):    print(f\"{name}: {name.encode() in bytecode}\")PY<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:<\/p>\n<pre><code>syncLegacyEntries: TruesyncDateEntries: False<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0443\u0436\u0435 \u0431\u044b\u043b \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0430 \u0432 JAR \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u0439. \u0412 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0432\u043f\u0430\u0432\u0448\u0438\u043c\u0438 ID \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e, \u0447\u0442\u043e VPS \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430.<\/p>\n<p>\u042d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e Java-\u043a\u043b\u0430\u0441\u0441\u0430, \u0430 \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u043b\u0443\u0447\u0448\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c SHA \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0432 \u0442\u0435\u0433 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c OCI-\u043c\u0435\u0442\u043a\u0443 <code>org.opencontainers.image.revision<\/code> \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0435\u0451 \u0443 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<h3>\u041a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435<\/h3>\n<p>\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435:<\/p>\n<pre><code class=\"yaml\">- name: SSH &amp; Deploy  uses: appleboy\/ssh-action@v0.1.10  with:    host: ${{ secrets.SERVER_HOST }}    username: ${{ secrets.SERVER_USER }}    key: ${{ secrets.SERVER_SSH_KEY }}    script: |      set -e      docker pull ghcr.io\/example\/app:COMMIT_SHA      docker compose down      docker compose up -d<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0422\u0430\u043a \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e <code>docker compose down<\/code>, \u0438 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0438\u0437-\u0437\u0430 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0435\u0439\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u0438 <code>appleboy\/ssh-action@v0.1.10<\/code> \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>script_stop: true<\/code>. \u0412 \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Action \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0443\u0434\u0430\u043b\u0451\u043d; \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0441\u043e\u0432\u0435\u0442\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c <code>set -e<\/code> \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430.<\/p>\n<h3>\u0422\u0435\u0433 \u043e\u0431\u0440\u0430\u0437\u0430 \u043f\u043e SHA \u043a\u043e\u043c\u043c\u0438\u0442\u0430<\/h3>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0440\u0438\u0441\u043a \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u0441 \u0442\u0435\u0433\u043e\u043c latest \u2014 \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 SHA \u043a\u043e\u043c\u043c\u0438\u0442\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f, \u0438 \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u0433\u0443. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043a\u0443 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438, \u043d\u043e \u0441\u0430\u043c \u0442\u0435\u0433 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0437 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u043d \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430: \u0442\u0435\u0433 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c. \u0414\u043b\u044f \u0442\u043e\u0447\u043d\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 digest.<\/p>\n<pre><code class=\"yaml\">- name: Build Docker image  run: docker build \\    -t ghcr.io\/${{ github.repository_owner }}\/example_backend:${{ github.sha }} .- name: Push Docker image  run: docker push \\    ghcr.io\/${{ github.repository_owner }}\/example_backend:${{ github.sha }}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0412 Compose \u0442\u0435\u0433 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e:<\/p>\n<pre><code class=\"yaml\">services:  example:    image: ghcr.io\/example\/example_backend:${EXAMPLE_BACKEND_TAG:?EXAMPLE_BACKEND_TAG must be set}<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0410 \u0432 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 SHA:<\/p>\n<pre><code class=\"yaml\">script: |  set -e  export EXAMPLE_BACKEND_TAG=${{ github.sha }}  docker pull \"ghcr.io\/example\/example_backend:${EXAMPLE_BACKEND_TAG}\"  docker compose -f .\/somedir\/docker-compose.yml down  docker compose -f .\/somedir\/docker-compose.yml up -d<\/code><div class=\"code-explainer\"><a href=\"https:\/\/sourcecraft.dev\/\" class=\"tm-button code-explainer__link\" style=\"visibility: hidden;\"><span class=\"sc-logo-wrapper icon-only\"><\/span><\/a><\/div><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c SHA-\u0442\u0435\u0433\u043e\u043c \u0435\u0449\u0451 \u043d\u0435\u0442 \u043d\u0430 VPS \u0438 \u0440\u0435\u0435\u0441\u0442\u0440 \u043e\u0442\u043a\u0430\u0436\u0435\u0442 \u0432 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 docker pull \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u0421 set -e \u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e docker compose down, \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c\u0438. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0437 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u044d\u0448\u0435, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u2014 \u0441\u0430\u043c \u0444\u0430\u043a\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432 \u043a\u044d\u0448\u0435 \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u0434 \u0441\u0442\u0430\u0440\u044b\u0439. \u041d\u043e \u0431\u0435\u0437 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 docker pull \u043a\u043e\u043c\u0430\u043d\u0434\u044b down \u0438 up \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f, \u0438 Compose \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 SHA-\u0442\u0435\u0433 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441 \u0442\u0435\u0433\u0430 <code>latest<\/code> \u043d\u0430 \u0442\u0435\u0433 \u0441 SHA \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0432 registry, \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u0438\u0442\u044c registry. \u041d\u043e \u0432\u0430\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0438 \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f \u043e\u0442\u043a\u0430\u0442\u0430, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0440\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b \u0443\u0434\u0430\u043b\u044f\u043b\u0438\u0441\u044c.<\/p>\n<h3>\u041a\u0430\u043a\u043e\u0439 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0432\u043e\u0434?<\/h3>\n<ul>\n<li>\n<p>\u0417\u0435\u043b\u0451\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 job \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0443\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043b\u043e\u0433\u0430\u0445 \u0434\u0430\u0436\u0435 \u0443 \u0437\u0435\u043b\u0451\u043d\u044b\u0445 \u0434\u0435\u043f\u043b\u043e\u0435\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0437 \u0438 \u043a\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u0435\u043f\u043b\u043e\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043e \u043a\u043e\u043c\u0430\u043d\u0434, \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0435\u0433 \u0441 SHA \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0437 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438, \u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 fail-fast \u0438 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0431\u0440\u0430\u0437\u0430.<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<p>\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/1110582\/\">https:\/\/habr.com\/ru\/articles\/1110582\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u044c\u0442\u0435: \u0434\u0435\u043f\u043b\u043e\u0439 \u043f\u0440\u043e\u0448\u0451\u043b, \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0437\u0435\u043b\u0451\u043d\u044b\u0439. \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0441\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e \u2014 \u044d\u0442\u043e \u0432\u0438\u0434\u043d\u043e \u0432 \u043b\u043e\u0433\u0430\u0445. \u041d\u043e \u043d\u0430 \u043f\u0440\u043e\u0434\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043d\u0435\u0442. \u0412 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u0437\u0430\u0434\u0430\u044e\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0443. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0435\u043f\u0440\u0438\u044f\u0442\u043d\u043e, \u0435\u0441\u043b\u0438 \u043e\u043d \u043a\u0430\u043a \u0440\u0430\u0437 \u043b\u043e\u0432\u0438\u0442 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0438\u0439 \u0431\u0430\u0433.\u041d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u043e \u043d\u0435 \u0432 \u0431\u0430\u0433\u0435. \u041a\u043e\u0434 \u043c\u043e\u0433 \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440.\u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d \u043e\u0434\u043d\u043e\u0441\u0435\u0440\u0432\u0435\u0440\u043d\u044b\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u0447\u0435\u0440\u0435\u0437 Docker Compose, \u0431\u0435\u0437 blue-green \u0438 \u0431\u0435\u0437 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0435\u0437 \u043f\u0435\u0440\u0435\u0440\u044b\u0432\u0430. \u0417\u0434\u0435\u0441\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0435\u043d \u043d\u0435 \u043e\u0431\u0440\u0430\u0437\u0446\u043e\u0432\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0432\u044b\u043a\u043b\u0430\u0434\u043a\u0438, \u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u043a\u043e\u043c\u0430\u043d\u0434.\u041a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438GitHub Actions \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u043b Docker-\u043e\u0431\u0440\u0430\u0437 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043b \u0435\u0433\u043e \u0432 GHCR. \u041d\u0430 \u044d\u0442\u0430\u043f\u0435 \u0434\u0435\u043f\u043b\u043e\u044f VPS \u043d\u0435 \u0441\u043c\u043e\u0433 \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437:err: Error response from daemon: Head&#187;https:\/\/ghcr.io\/v2\/example\/app\/manifests\/latest&#187;: denied: denied\u042d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b\u043e \u043a\u0430\u043a \u043e\u0448\u0438\u0431\u043a\u0430, \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u0435\u043f\u043b\u043e\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u043b \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f. \u041d\u043e \u0432 \u043a\u043e\u043d\u0446\u0435 \u0448\u0430\u0433\u0430 \u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u0437\u0435\u043b\u0451\u043d\u0430\u044f \u0433\u0430\u043b\u043e\u0447\u043a\u0430:\u2705 Successfully executed commands to all host.Workflow \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043b\u0441\u044f \u043a VPS \u043f\u043e SSH \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043b \u0442\u0430\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b. \u0421\u0430\u043c\u043e \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0448\u043b\u043e \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u041e\u0448\u0438\u0431\u043a\u043e\u0439 \u0431\u044b\u043b docker pull, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0438\u0439\u0441\u044f appleboy\/ssh-action@v0.1.10 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b \u0441\u043a\u0440\u0438\u043f\u0442 \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0451: \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 script\\_stop \u0431\u044b\u043b \u0432\u044b\u043a\u043b\u044e\u0447\u0435\u043d. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u0438\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:docker compose downdocker compose up -d\u041d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0443\u0436\u0435 \u043b\u0435\u0436\u0430\u043b \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043e\u0431\u0440\u0430\u0437. \u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043b\u0438\u0441\u044c \u0438\u0437 \u043d\u0435\u0433\u043e, \u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 SSH Action \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u043e\u0431 \u0443\u0441\u043f\u0435\u0445\u0435, \u0445\u043e\u0442\u044f \u043d\u043e\u0432\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0434\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u043d\u0435 \u0434\u043e\u0435\u0445\u0430\u043b.\u042d\u0442\u043e \u043d\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 SSH-\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f. SSH \u0437\u0434\u0435\u0441\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0440\u0430\u043d\u0441\u043f\u043e\u0440\u0442: GitHub Actions \u043f\u0435\u0440\u0435\u0434\u0430\u043b \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0441\u0435\u0440\u0432\u0435\u0440\u0443, \u0430 Action \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0412 \u044d\u0442\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0448\u0430\u0433\u0430 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u0430 \u0441\u043a\u0440\u0438\u043f\u0442, \u0430 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043f\u0440\u0438\u0432\u0435\u043b\u043e \u043a \u0437\u0435\u043b\u0451\u043d\u043e\u043c\u0443 \u0441\u0442\u0430\u0442\u0443\u0441\u0443 \u0432\u0441\u0435\u0433\u043e \u0448\u0430\u0433\u0430.\u041a\u0430\u043a \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c ID \u043e\u0431\u0440\u0430\u0437\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440, \u0441 ID \u043e\u0431\u0440\u0430\u0437\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0442\u0435\u0433 latest:docker inspect app-container \\  &#8212;format &#8216;container image={{.Image}}&#8217;docker image inspect ghcr.io\/example\/app:latest \\  &#8212;format &#8216;local latest image={{.Id}}&#8217;\u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0431\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u0432\u044b\u0432\u0435\u043b\u0438 \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 ID:container image=sha256:&lt;\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 ID&gt;local latest image=sha256:&lt;\u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 ID&gt;\u042d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e, \u0447\u0442\u043e \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0442\u043e\u0442 \u0436\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u0442\u0435\u0433 latest. \u0421\u0430\u043c\u043e \u0441\u043e\u0432\u043f\u0430\u0434\u0435\u043d\u0438\u0435 ID \u0435\u0449\u0451 \u043d\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u0442, \u0441\u0442\u0430\u0440\u044b\u0439 \u044d\u0442\u043e \u043a\u043e\u0434 \u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439, \u0438 \u043d\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u0442 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437 \u0441 \u0440\u0435\u0435\u0441\u0442\u0440\u043e\u043c.\u0421\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 Java, \u0442\u043e \u0432\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c JAR \u0438\u0437 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432 Java-\u043a\u043b\u0430\u0441\u0441\u0435 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0438\u043c\u0451\u043d \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u0438 \u043d\u043e\u0432\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u0418\u043c\u0435\u043d\u0430 \u0438 \u043f\u0443\u0442\u044c \u0437\u0434\u0435\u0441\u044c \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0443\u0441\u043b\u043e\u0432\u043d\u044b\u0435:docker cp app-container:\/app\/app.jar \/tmp\/running-app.jarpython3 &#8212; &lt;&lt;&#8216;PY&#8217;from zipfile import ZipFileclass_path = &#171;BOOT-INF\/classes\/com\/example\/sync\/SyncService.class&#187;with ZipFile(&#171;\/tmp\/running-app.jar&#187;) as jar:    bytecode = jar.read(class_path)for name in (&#171;syncLegacyEntries&#187;, &#171;syncDateEntries&#187;):    print(f&#187;{name}: {name.encode() in bytecode}&#187;)PY\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442:syncLegacyEntries: TruesyncDateEntries: False\u0412 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0443\u0436\u0435 \u0431\u044b\u043b \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0430 \u0432 JAR \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043b\u0441\u044f \u0441\u0442\u0430\u0440\u044b\u0439. \u0412 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0438 \u0441 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u0441\u043e\u0432\u043f\u0430\u0432\u0448\u0438\u043c\u0438 ID \u044d\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e, \u0447\u0442\u043e VPS \u043f\u0435\u0440\u0435\u0441\u043e\u0437\u0434\u0430\u043b \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0438\u0437 \u0441\u0442\u0430\u0440\u043e\u0433\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043e\u0431\u0440\u0430\u0437\u0430.\u042d\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e Java-\u043a\u043b\u0430\u0441\u0441\u0430, \u0430 \u043d\u0435 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043d\u043e\u0441\u0442\u0438\u043a\u0438 \u043b\u0443\u0447\u0448\u0435 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c SHA \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0432 \u0442\u0435\u0433 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c OCI-\u043c\u0435\u0442\u043a\u0443 org.opencontainers.image.revision \u0438 \u0437\u0430\u0442\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u0435\u0451 \u0443 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438\u043b\u0438 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.\u041a\u0430\u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435\u0412 \u043d\u0430\u0447\u0430\u043b\u0435 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043f\u0440\u0438 \u043e\u0448\u0438\u0431\u043a\u0435:- name: SSH &amp; Deploy  uses: appleboy\/ssh-action@v0.1.10  with:    host: ${{ secrets.SERVER_HOST }}    username: ${{ secrets.SERVER_USER }}    key: ${{ secrets.SERVER_SSH_KEY }}    script: |      set -e      docker pull ghcr.io\/example\/app:COMMIT_SHA      docker compose down      docker compose up -d\u0422\u0430\u043a \u043e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043e docker compose down, \u0438 \u0443\u0436\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0438\u0437-\u0437\u0430 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f.\u0412 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432\u0448\u0435\u0439\u0441\u044f \u0432\u0435\u0440\u0441\u0438\u0438 appleboy\/ssh-action@v0.1.10 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0430\u043a\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043b \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 script_stop: true. \u0412 \u0431\u043e\u043b\u0435\u0435 \u043d\u043e\u0432\u044b\u0445 \u0432\u0435\u0440\u0441\u0438\u044f\u0445 Action \u044d\u0442\u043e\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u0443\u0434\u0430\u043b\u0451\u043d; \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0441\u043e\u0432\u0435\u0442\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c set -e \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430.\u0422\u0435\u0433 \u043e\u0431\u0440\u0430\u0437\u0430 \u043f\u043e SHA \u043a\u043e\u043c\u043c\u0438\u0442\u0430\u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043d\u0438\u0437\u0438\u0442\u044c \u0440\u0438\u0441\u043a \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0437 \u0441 \u0442\u0435\u0433\u043e\u043c latest \u2014 \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0437 SHA \u043a\u043e\u043c\u043c\u0438\u0442\u0430, \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u043e\u0431\u0440\u0430\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f, \u0438 \u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0442\u0435\u0433\u0443. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u0441\u0431\u043e\u0440\u043a\u0443 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438, \u043d\u043e \u0441\u0430\u043c \u0442\u0435\u0433 \u043d\u0435 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0437 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0431\u0440\u0430\u043d \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430: \u0442\u0435\u0433 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c. \u0414\u043b\u044f \u0442\u043e\u0447\u043d\u043e\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 digest.- name: Build Docker image  run: docker build \\    -t ghcr.io\/${{ github.repository_owner }}\/example_backend:${{ github.sha }} .- name: Push Docker image  run: docker push \\    ghcr.io\/${{ github.repository_owner }}\/example_backend:${{ github.sha }}\u0412 Compose \u0442\u0435\u0433 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e:services:  example:    image: ghcr.io\/example\/example_backend:${EXAMPLE_BACKEND_TAG:?EXAMPLE_BACKEND_TAG must be set}\u0410 \u0432 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 SHA:script: |  set -e  export EXAMPLE_BACKEND_TAG=${{ github.sha }}  docker pull &#171;ghcr.io\/example\/example_backend:${EXAMPLE_BACKEND_TAG}&#187;  docker compose -f .\/somedir\/docker-compose.yml down  docker compose -f .\/somedir\/docker-compose.yml up -d\u0415\u0441\u043b\u0438 \u043e\u0431\u0440\u0430\u0437\u0430 \u0441 \u043d\u0443\u0436\u043d\u044b\u043c SHA-\u0442\u0435\u0433\u043e\u043c \u0435\u0449\u0451 \u043d\u0435\u0442 \u043d\u0430 VPS \u0438 \u0440\u0435\u0435\u0441\u0442\u0440 \u043e\u0442\u043a\u0430\u0436\u0435\u0442 \u0432 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u0438, \u043a\u043e\u043c\u0430\u043d\u0434\u0430 docker pull \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u043e\u0439. \u0421 set -e \u0441\u043a\u0440\u0438\u043f\u0442 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0434\u043e docker compose down, \u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u043e\u0441\u0442\u0430\u043d\u0443\u0442\u0441\u044f \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u043d\u044b\u043c\u0438. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0437 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u043c \u043a\u044d\u0448\u0435, \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u2014 \u0441\u0430\u043c \u0444\u0430\u043a\u0442 \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0432 \u043a\u044d\u0448\u0435 \u043d\u0435 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u043e\u0434 \u0441\u0442\u0430\u0440\u044b\u0439. \u041d\u043e \u0431\u0435\u0437 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 docker pull \u043a\u043e\u043c\u0430\u043d\u0434\u044b down \u0438 up \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f, \u0438 Compose \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u0440\u0430\u0437. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 SHA-\u0442\u0435\u0433 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u0430\u0442\u044c \u0432\u0435\u0440\u0441\u0438\u0438, \u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a.\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435. \u041f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u0441 \u0442\u0435\u0433\u0430 latest \u043d\u0430 \u0442\u0435\u0433 \u0441 SHA \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0435\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0430\u044f \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0432 registry, \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0431\u0438\u0442\u044c registry. \u041d\u043e \u0432\u0430\u0436\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0432\u0435\u0440\u0441\u0438\u0439 \u0438 \u043e\u0431\u0440\u0430\u0437 \u0434\u043b\u044f \u043e\u0442\u043a\u0430\u0442\u0430, \u0430 \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u0440\u044b\u0435 \u043e\u0431\u0440\u0430\u0437\u044b \u0443\u0434\u0430\u043b\u044f\u043b\u0438\u0441\u044c.\u041a\u0430\u043a\u043e\u0439 \u0438\u0437 \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u044b\u0432\u043e\u0434?\u0417\u0435\u043b\u0451\u043d\u044b\u0439 \u0441\u0442\u0430\u0442\u0443\u0441 job \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043b\u0430\u0441\u044c \u0443\u0441\u043f\u0435\u0448\u043d\u043e.\u041d\u0443\u0436\u043d\u043e \u0447\u0438\u0442\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432 \u043b\u043e\u0433\u0430\u0445 \u0434\u0430\u0436\u0435 \u0443 \u0437\u0435\u043b\u0451\u043d\u044b\u0445 \u0434\u0435\u043f\u043b\u043e\u0435\u0432.\u041d\u0430 \u0443\u0434\u0430\u043b\u0451\u043d\u043d\u043e\u043c \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u043a\u0430\u043a\u043e\u0439 \u043e\u0431\u0440\u0430\u0437 \u0438 \u043a\u043e\u0434 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u044b.\u0421\u043a\u0440\u0438\u043f\u0442 \u0434\u0435\u043f\u043b\u043e\u044f \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0434\u043e \u043a\u043e\u043c\u0430\u043d\u0434, \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0441\u0435\u0440\u0432\u0438\u0441.\u0422\u0435\u0433 \u0441 SHA \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0441\u043e\u043e\u0442\u043d\u0435\u0441\u0442\u0438 \u043e\u0431\u0440\u0430\u0437 \u0441 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0430\u043c\u0438, \u043d\u043e \u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442 fail-fast \u0438 \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u043d\u0435 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0431\u0440\u0430\u0437\u0430.\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 https:\/\/habr.com\/ru\/articles\/1110582\/<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-504205","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/504205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=504205"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/504205\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=504205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=504205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=504205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}