update
Build & Deploy (develop) / build-and-deploy (push) Successful in 1m44s

This commit is contained in:
2026-09-14 08:36:22 +03:30
parent c4d9351e91
commit fe86b58012
5 changed files with 102 additions and 68 deletions
+6 -2
View File
@@ -33,9 +33,11 @@ jobs:
docker build -t robot-market:${{ steps.vars.outputs.sha }} . docker build -t robot-market:${{ steps.vars.outputs.sha }} .
- name: Save previous tag for rollback - name: Save previous tag for rollback
id: backup
run: | run: |
if [ -f /opt/robot-market-front/.env ]; then if [ -f /opt/robot-market-front/.env ]; then
cp /opt/robot-market-front/.env /opt/robot-market-front/.env.previous cp /opt/robot-market-front/.env /opt/robot-market-front/.env.previous
echo "available=true" >> "$GITHUB_OUTPUT"
fi fi
- name: Point compose at this build - name: Point compose at this build
@@ -43,12 +45,14 @@ jobs:
echo "IMAGE_TAG=${{ steps.vars.outputs.sha }}" > /opt/robot-market-front/.env echo "IMAGE_TAG=${{ steps.vars.outputs.sha }}" > /opt/robot-market-front/.env
- name: Deploy via compose - name: Deploy via compose
id: deploy
run: | run: |
docker compose --env-file /opt/robot-market-front/.env \ docker compose --env-file /opt/robot-market-front/.env \
-f /opt/robot-market-front/docker-compose.yml \ -f /opt/robot-market-front/docker-compose.yml \
up -d --force-recreate up -d --force-recreate
- name: Health check (retries for ~30s) - name: Health check (retries for ~30s)
id: health
run: | run: |
for i in $(seq 1 15); do for i in $(seq 1 15); do
if docker exec robot-market node -e " if docker exec robot-market node -e "
@@ -65,8 +69,8 @@ jobs:
echo "Health check failed after 30s" echo "Health check failed after 30s"
exit 1 exit 1
- name: Roll back to previous version on failed health check - name: Roll back after deployment or health check failure
if: failure() if: ${{ failure() && steps.backup.outputs.available == 'true' && (steps.deploy.outcome == 'failure' || steps.health.outcome == 'failure') }}
run: | run: |
if [ -f /opt/robot-market-front/.env.previous ]; then if [ -f /opt/robot-market-front/.env.previous ]; then
cp /opt/robot-market-front/.env.previous /opt/robot-market-front/.env cp /opt/robot-market-front/.env.previous /opt/robot-market-front/.env
+74 -56
View File
@@ -4,10 +4,12 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="bb7b50a5-be9c-4cd7-a05b-979f0e91b173" name="Changes" comment="initial new branch"> <list default="true" id="bb7b50a5-be9c-4cd7-a05b-979f0e91b173" name="Changes" comment="update">
<change beforePath="$PROJECT_DIR$/.gitea/workflows/develop.yml" beforeDir="false" afterPath="$PROJECT_DIR$/.gitea/workflows/develop.yml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/page.jsx" beforeDir="false" afterPath="$PROJECT_DIR$/app/page.jsx" afterDir="false" /> <change beforePath="$PROJECT_DIR$/components/CartDrawer.jsx" beforeDir="false" afterPath="$PROJECT_DIR$/components/CartDrawer.jsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/components/Header.jsx" beforeDir="false" afterPath="$PROJECT_DIR$/components/Header.jsx" afterDir="false" /> <change beforePath="$PROJECT_DIR$/components/Header.jsx" beforeDir="false" afterPath="$PROJECT_DIR$/components/Header.jsx" afterDir="false" />
<change beforePath="$PROJECT_DIR$/store/cartSlice.js" beforeDir="false" afterPath="$PROJECT_DIR$/store/cartSlice.js" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -29,61 +31,61 @@
</component> </component>
<component name="NextEditCompletionFeaturesState"> <component name="NextEditCompletionFeaturesState">
<decayedCancelled> <decayedCancelled>
<entry key="MS100" value="1.0000000922420618" /> <entry key="MS100" value="1.004744177134286" />
<entry key="MS500" value="1.0391729068887716" /> <entry key="MS500" value="1.575240101022852" />
<entry key="S2" value="1.4450722698297225" /> <entry key="S2" value="2.764135174065891" />
<entry key="S5" value="1.7960577813444258" /> <entry key="S5" value="3.448835067490734" />
<entry key="S10" value="2.390341011555007" /> <entry key="S10" value="4.169244601553037" />
<entry key="S30" value="4.436663996737558" /> <entry key="S30" value="6.312324351429616" />
<entry key="S60" value="6.891199307173083" /> <entry key="S60" value="8.799128624106114" />
<entry key="M2" value="11.14713973926092" /> <entry key="M2" value="13.075282949566317" />
<entry key="M5" value="19.25700511515129" /> <entry key="M5" value="21.208597569347642" />
<entry key="M10" value="24.75392717332414" /> <entry key="M10" value="26.723057802373717" />
<entry key="M15" value="27.266710515049287" /> <entry key="M15" value="29.24409948387227" />
<entry key="M30" value="31.241093602530974" /> <entry key="M30" value="33.22818221953257" />
<entry key="H1" value="35.61892475228196" /> <entry key="H1" value="37.61158513107687" />
<entry key="H2" value="39.60233048673669" /> <entry key="H2" value="41.59825862074022" />
<entry key="H4" value="42.410722799497165" /> <entry key="H4" value="44.40854514760487" />
<entry key="D1" value="45.337839249335104" /> <entry key="D1" value="47.33745168978149" />
<entry key="W1" value="45.90369454213566" /> <entry key="W1" value="47.90363849664463" />
</decayedCancelled> </decayedCancelled>
<decayedSelected> <decayedSelected>
<entry key="MS100" value="0.0" /> <entry key="MS100" value="0.0" />
<entry key="MS500" value="9.436418725306431E-247" /> <entry key="MS500" value="2.2072337736932312E-247" />
<entry key="S2" value="3.1167487999584076E-62" /> <entry key="S2" value="2.1675148581054447E-62" />
<entry key="S5" value="2.497357521548065E-25" /> <entry key="S5" value="2.159657258399454E-25" />
<entry key="S10" value="4.997356822909551E-13" /> <entry key="S10" value="4.647211269567431E-13" />
<entry key="S30" value="7.935606419288513E-5" /> <entry key="S30" value="7.745761828173629E-5" />
<entry key="S60" value="0.00890820207409358" /> <entry key="S60" value="0.008801000981805213" />
<entry key="M2" value="0.09438327221543853" /> <entry key="M2" value="0.09381365029570697" />
<entry key="M5" value="0.3890075335665943" /> <entry key="M5" value="0.3880667324850055" />
<entry key="M10" value="0.6237046845796449" /> <entry key="M10" value="0.6229500240669436" />
<entry key="M15" value="0.7299940786200081" /> <entry key="M15" value="0.7294051152067237" />
<entry key="M30" value="0.8543969092991899" /> <entry key="M30" value="0.8540521735858551" />
<entry key="H1" value="0.9243359288154875" /> <entry key="H1" value="0.9241494324977185" />
<entry key="H2" value="0.9614239069294499" /> <entry key="H2" value="0.961326912396464" />
<entry key="H4" value="0.9805222623324006" /> <entry key="H4" value="0.9804728004368417" />
<entry key="D1" value="0.9967270464079093" /> <entry key="D1" value="0.9967186663423039" />
<entry key="W1" value="0.9995317780186643" /> <entry key="W1" value="0.9995305774933927" />
</decayedSelected> </decayedSelected>
<decayedShown> <decayedShown>
<entry key="MS100" value="0.721964656545298" /> <entry key="MS100" value="0.6384859876128298" />
<entry key="MS500" value="0.9727188811842931" /> <entry key="MS500" value="1.375261985192324" />
<entry key="S2" value="1.4189996850900028" /> <entry key="S2" value="2.659996086992145" />
<entry key="S5" value="1.7821693267388077" /> <entry key="S5" value="3.396985510197626" />
<entry key="S10" value="2.3798711215683763" /> <entry key="S10" value="4.138561241859121" />
<entry key="S30" value="4.429068687716572" /> <entry key="S30" value="6.297687647760917" />
<entry key="S60" value="6.89378526581655" /> <entry key="S60" value="8.798041013734146" />
<entry key="M2" value="11.235932446498248" /> <entry key="M2" value="13.161710763363537" />
<entry key="M5" value="19.64164646632595" /> <entry key="M5" value="21.59157519741697" />
<entry key="M10" value="25.3746875193938" /> <entry key="M10" value="27.342699996268685" />
<entry key="M15" value="27.994515469781604" /> <entry key="M15" value="29.971072468875995" />
<entry key="M30" value="32.09425472255502" /> <entry key="M30" value="34.080876681341785" />
<entry key="H1" value="36.54259305743418" /> <entry key="H1" value="38.535005855332265" />
<entry key="H2" value="40.56340345758414" /> <entry key="H2" value="42.55920402063908" />
<entry key="H4" value="43.39106428503869" /> <entry key="H4" value="45.38882187391485" />
<entry key="D1" value="46.33453530765634" /> <entry key="D1" value="48.33413681714609" />
<entry key="W1" value="46.90322187037677" /> <entry key="W1" value="48.90316425991373" />
</decayedShown> </decayedShown>
</component> </component>
<component name="ProjectColorInfo">{ <component name="ProjectColorInfo">{
@@ -195,7 +197,15 @@
<workItem from="1788772211468" duration="3288000" /> <workItem from="1788772211468" duration="3288000" />
<workItem from="1788845304938" duration="5986000" /> <workItem from="1788845304938" duration="5986000" />
<workItem from="1789189667293" duration="1409000" /> <workItem from="1789189667293" duration="1409000" />
<workItem from="1789191385769" duration="404000" /> <workItem from="1789191385769" duration="3038000" />
<workItem from="1789200888982" duration="408000" />
<workItem from="1789202103910" duration="646000" />
<workItem from="1789202776318" duration="599000" />
<workItem from="1789207496509" duration="153000" />
<workItem from="1789278993260" duration="734000" />
<workItem from="1789360783891" duration="48000" />
<workItem from="1789361888102" duration="68000" />
<workItem from="1789362025574" duration="23000" />
</task> </task>
<task id="LOCAL-00001" summary="update"> <task id="LOCAL-00001" summary="update">
<option name="closed" value="true" /> <option name="closed" value="true" />
@@ -421,7 +431,15 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1788682678051</updated> <updated>1788682678051</updated>
</task> </task>
<option name="localTasksCounter" value="29" /> <task id="LOCAL-00029" summary="update">
<option name="closed" value="true" />
<created>1789191804591</created>
<option name="number" value="00029" />
<option name="presentableId" value="LOCAL-00029" />
<option name="project" value="LOCAL" />
<updated>1789191804591</updated>
</task>
<option name="localTasksCounter" value="30" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@@ -432,10 +450,10 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<MESSAGE value="ui : change the position of header in Hero Section" /> <MESSAGE value="ui : change the position of header in Hero Section" />
<MESSAGE value="update" />
<MESSAGE value="feat:dockerized &amp; test actions add" /> <MESSAGE value="feat:dockerized &amp; test actions add" />
<MESSAGE value="feat:dockerized &amp; test actions added" /> <MESSAGE value="feat:dockerized &amp; test actions added" />
<MESSAGE value="initial new branch" /> <MESSAGE value="initial new branch" />
<option name="LAST_COMMIT_MESSAGE" value="initial new branch" /> <MESSAGE value="update" />
<option name="LAST_COMMIT_MESSAGE" value="update" />
</component> </component>
</project> </project>
+3 -4
View File
@@ -11,8 +11,7 @@ import {
selectIsDrawerOpen, selectIsDrawerOpen,
closeDrawer, closeDrawer,
removeFromCart, removeFromCart,
incrementQty, setQuantity,
decrementQty,
} from '@/store/cartSlice'; } from '@/store/cartSlice';
import {useLanguage} from '@/app/context/LanguageContext'; import {useLanguage} from '@/app/context/LanguageContext';
import api from "@/lib/axios"; import api from "@/lib/axios";
@@ -77,10 +76,10 @@ export default function CartDrawer() {
<InputNumber <InputNumber
size="small" size="small"
min={1} min={1}
precision={0}
value={item.qty} value={item.qty}
onChange={(val) => { onChange={(val) => {
if (val > item.qty) dispatch(incrementQty(item.id)); if (val !== null) dispatch(setQuantity({id: item.id, qty: val}));
else if (val < item.qty) dispatch(decrementQty(item.id));
}} }}
className="w-16" className="w-16"
/> />
+11 -5
View File
@@ -80,16 +80,15 @@ export default function Header() {
{t.nav.login} {t.nav.login}
</Button> </Button>
{/* faz 1 */} <Badge count={cartCount} size="small" offset={[-2, 2]}>
{/* <Badge count={cartCount} size="small" offset={[-2, 2]}>
<Button <Button
shape="circle" shape="circle"
size="large" size="large"
icon={<ShoppingCartOutlined/>} icon={<ShoppingCartOutlined/>}
onClick={() => dispatch(openDrawer())} onClick={() => dispatch(openDrawer())}
aria-label="cart" aria-label={t.cart.title}
/> />
</Badge>*/} </Badge>
<button <button
className="xl:hidden text-brand-400 text-2xl" className="xl:hidden text-brand-400 text-2xl"
@@ -117,7 +116,14 @@ export default function Header() {
<div className="flex items-center gap-3 pt-2 border-t border-subtle"> <div className="flex items-center gap-3 pt-2 border-t border-subtle">
<LanguageToggle/> <LanguageToggle/>
<ThemeToggle/> <ThemeToggle/>
<Button icon={<UserOutlined/>} className="flex-1"> <Button
icon={<UserOutlined/>}
className="flex-1"
href="https://panel.my-rm.com"
target="_blank"
rel="noopener noreferrer"
onClick={() => setMobileOpen(false)}
>
{t.nav.login} {t.nav.login}
</Button> </Button>
</div> </div>
+7
View File
@@ -22,6 +22,12 @@ const cartSlice = createSlice({
removeFromCart: (state, action) => { removeFromCart: (state, action) => {
state.items = state.items.filter((item) => item.id !== action.payload); state.items = state.items.filter((item) => item.id !== action.payload);
}, },
setQuantity: (state, action) => {
const { id, qty } = action.payload;
if (!Number.isSafeInteger(qty) || qty < 1) return;
const item = state.items.find((item) => item.id === id);
if (item) item.qty = qty;
},
incrementQty: (state, action) => { incrementQty: (state, action) => {
const item = state.items.find((item) => item.id === action.payload); const item = state.items.find((item) => item.id === action.payload);
if (item) item.qty += 1; if (item) item.qty += 1;
@@ -52,6 +58,7 @@ const cartSlice = createSlice({
export const { export const {
addToCart, addToCart,
removeFromCart, removeFromCart,
setQuantity,
incrementQty, incrementQty,
decrementQty, decrementQty,
clearCart, clearCart,