<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.it-core.eu/wiki/index.php?action=history&amp;feed=atom&amp;title=Jak_Nastavit_CI%2FCD_Pipeline_S_GitHub_Actions</id>
	<title>Jak Nastavit CI/CD Pipeline S GitHub Actions - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.it-core.eu/wiki/index.php?action=history&amp;feed=atom&amp;title=Jak_Nastavit_CI%2FCD_Pipeline_S_GitHub_Actions"/>
	<link rel="alternate" type="text/html" href="https://www.it-core.eu/wiki/index.php?title=Jak_Nastavit_CI/CD_Pipeline_S_GitHub_Actions&amp;action=history"/>
	<updated>2026-08-22T10:59:00Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://www.it-core.eu/wiki/index.php?title=Jak_Nastavit_CI/CD_Pipeline_S_GitHub_Actions&amp;diff=142932&amp;oldid=prev</id>
		<title>DannieCunneen1 at 20:06, 21 August 2026</title>
		<link rel="alternate" type="text/html" href="https://www.it-core.eu/wiki/index.php?title=Jak_Nastavit_CI/CD_Pipeline_S_GitHub_Actions&amp;diff=142932&amp;oldid=prev"/>
		<updated>2026-08-21T20:06:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 04:06, 22 August 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při psaní příkazů se vyhněte tvrdě zakódovaným tajemstvím, jako jsou API klíče nebo hesla. &lt;/del&gt;GitHub Actions &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;umožňuje ukládat &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;do sekce Secrets &lt;/del&gt;v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nastavení repozitáře &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v souboru je pak odkazujete přes $ secrets&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;NAZEV . Tím &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hodnoty nezobrazí v logu a můžete &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;měnit bez úpravy kódu&lt;/del&gt;. Klíčové je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;také správně nastavit oprávnění tokenu – pokud potřebujete nasadit na produkci&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vytvořte si osobní přístupový token s minimálními právy &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uložte ho jako secret&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nikdy nepoužívejte výchozí GITHUB_TOKEN pro akce s vyššími oprávněními&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na závěr si osvojte jednu užitečnou návyk&lt;/del&gt;: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pište si ke každému projektu soubor &lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dockerignore&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Do něj vložte složky jako node_modules &lt;/del&gt;nebo .&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;git&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby se při buildu nekopírovaly zbytečné soubory&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejenže to zrychlí build, ale také zabrání tomu&lt;/del&gt;, aby se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;do obrazu dostaly citlivé údaje &lt;/del&gt;z &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vašeho lokálního prostředí&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Docker není kouzlo&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale když se naučíte jeho základní principy&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ušetří vám hodiny práce při nasazování aplikací&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyzkoušejte si to na malém projektu – vytvořte si vlastní obraz&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spusťte ho a postupně přidávejte další &lt;/del&gt;funkce, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jako jsou svazky nebo síťová propojení mezi kontejnery&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Za pár dní zjistíte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že bez kontejnerů už nechcete pracovat&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Typickou chybou je spoléhat na skutečné &lt;/del&gt;API &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;volání nebo na globální store. Takový test je pomalý &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;náchylný na selhání z důvodu síťových výpadků&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Další častou chybou je zapomenout na asynchronní povahu thunku &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;test skončí dřív, než thunk stihne dokončit&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Řešením je použít async/await nebo zpětné volání&lt;/del&gt;, které &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;počká na dokončení. V neposlední řadě se vyvarujte testování reducerů přes store – to je integrační test, který nepotřebujete pro pokrytí čisté logiky&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jak si vytvořit první kontejner a nespálit se Základním stavebním kamenem je soubor Dockerfile&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ten popisuje&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak se má výsledný obraz vytvořit&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte jednoduchým příkladem: vezměte oficiální obraz jazyka Python, nakopírujte &lt;/del&gt;do &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;něj svůj skript a nastavte příkaz&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který se má spustit&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dodržet pořadí instrukcí&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud totiž změníte pouze kód aplikace&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Docker využije cache a build proběhne rychle&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud ale nejprve zkopírujete celý projekt a teprve poté instalujete závislosti&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;každá změna v kódu způsobí, že &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;závislosti instalují znovu, což je pomalé a frustrující&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jakmile máte Docker v provozu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;začněte s jednoduchým projektem&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vytvořte složku&lt;/del&gt;, do &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ní vložte soubor s názvem Dockerfile &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;do něj napište následující řádky: FROM node:20-alpine&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;WORKDIR /app&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;COPY . &lt;/del&gt;., &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;RUN npm install &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CMD [&quot;node&quot;, &quot;server&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;js&quot;]. Tento Dockerfile říká Dockeru, aby použil oficiální obraz &lt;/del&gt;Node.js, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nastavil pracovní složku, zkopíroval soubory, nainstaloval závislosti a spustil server&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Poté &lt;/del&gt;v &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;terminálu spusťte docker build -t moje-aplikace . (tečka na konci je důležitá – označuje aktuální složku). Po úspěšném buildu spustíte kontejner příkazem docker run -p 3000:3000 moje-aplikace. Parametr -p mapuje port z kontejneru na váš počítač&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže aplikaci otevřete v prohlížeči na adrese localhost:3000&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Když &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;řekne Docker&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mnoho začátečníků si představí složitý nástroj pro správce sítí&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Opak je pravdou – Docker je v podstatě způsob&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak zabalit aplikaci i všechny její závislosti do jednoho přenosného balíčku, kterému se říká kontejner&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Místo instalace deseti různých verzí knihoven do systému &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vytvoříte obraz&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který obsahuje přesně to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co vaše aplikace potřebuje&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tento obraz pak můžete spustit kdekoli&lt;/del&gt;, kde je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nainstalovaný Docker – na notebooku&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;serveru i v cloudu. Pro začátek stačí pochopit tři základní pojmy: obraz, kontejner a Dockerfile&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Základní workflow začíná souborem ve složce &lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;github/workflows&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Název souboru &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zvolte podle účelu, například ci&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;yml. Na začátku definujete události, které pipeline spouští &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nejčastěji push do větve main &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pull requesty&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dále specifikujete Runner&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tedy prostředí, na kterém se úlohy vykonávají. Pro JavaScript &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Python stačí obvykle ubuntu-latest&lt;/del&gt;, ale &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud potřebujete Windows nebo macOS&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;GitHub nabízí i tyto varianty&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vždy je vhodné pinout verzi runneru&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abyste předešli nečekaným změnám ve výchozím prostředí&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Co &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;týče praktických rad&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vždy si ověřte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že obraz, který stahujete&lt;/del&gt;, je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;oficiální a aktualizovaný&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na veřejných registrech najdete tisíce obrazů&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale ne všechny jsou udržované&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Spolehněte se na ty&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které mají jasný popis &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jsou spravované přímo dodavatelem technologie. Dále &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyhněte používání tagu latest pro produkci&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;I když se &lt;/del&gt;to &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zdá pohodlné, takový obraz se může ze dne na den změnit a vaše aplikace pak přestane fungovat z ničeho nic&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Raději používejte konkrétní verze, i když &lt;/del&gt;to &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;znamená občasné manuální aktualizace&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&lt;/ins&gt;GitHub Actions je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dnes standardem pro automatizaci buildů, testů i nasazení. Namísto složité konfigurace externích nástrojů stačí definovat workflow přímo &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;repozitáři. Začnete vytvořením adresáře .github/workflows &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;do něj vložíte YAML soubor&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Každý workflow &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spouští na základě událostí, jako &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;push do větve, pull request nebo ruční trigger&lt;/ins&gt;. Klíčové je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pochopit, že každý krok běží v izolovaném prostředí&lt;/ins&gt;, a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;proto je nutné explicitně definovat&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co se má nainstalovat a jaké proměnné prostředí použít&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejčastější chyby a jak se jim vyhnout Chyba číslo jedna: ignorování cache. Bez cache se každý běh instaluje [https&lt;/ins&gt;:&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;//politiballwiki&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;net/wiki/Prvn%c3%ad_unit_test_bez_zbyte%c4%8dn%c3%a9ho_strachu:_praktick%c3%bd_postup byt v paneláku]še od začátku, což zbytečně prodlužuje pipeline&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;GitHub Actions nabízí akce pro caching závislostí – stačí zadat cestu k lockfile &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vendor adresáři&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Druhá častá chyba je spouštění workflow na každý push&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;i když jde jen o změnu dokumentace&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Použijte filtry paths nebo paths-ignore&lt;/ins&gt;, aby se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;build nespouštěl zbytečně. Třetí problém: nasazování na produkci &lt;/ins&gt;z &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;každé větve. Vždy omezte deploy na konkrétní větev (např. main) a přidejte schválení pro ruční spuštění&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;Bezpečné přesouvání a extrakce bez rizika Dalším užitečným nástrojem je „Move&quot; – umožňuje přesunout třídu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;metodu nebo proměnnou do jiného souboru či namespace. IDE automaticky upraví všechny odkazy&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže nemusíte ručně procházet celý projekt&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;U menších změn&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jako je rozdělení dlouhé &lt;/ins&gt;funkce, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;použijte „Extract Method&quot;. Označíte blok kódu, zvolíte název nové metody a IDE vytvoří metodu s odpovídajícími parametry&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pozor na to&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby extrahovaný blok nepoužíval příliš mnoho vnějších proměnných – jinak bude metoda nepřehledná&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ochrana &lt;/ins&gt;API &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;před neoprávněným přístupem není jen otázkou správné autentizace, ale také pečlivého návrhu celého toku předávání &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ověřování přístupových údajů&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;JWT (JSON Web Token) patří mezi nejrozšířenější metody, protože umožňuje bezstavovou autentizaci &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;server nemusí ukládat relace a token nese veškeré potřebné informace&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Přesto se při jeho nasazení často opakují stejné chyby&lt;/ins&gt;, které &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vedou k únikům dat nebo k úplnému obcházení ochrany&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro nasazení (CD) vytvořte [https://Sportsrants&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;com/?s=samostatn%C3%BD samostatný] job&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který závisí na úspěšném CI&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Využijte secrets pro přihlašovací údaje – nikdy je neukládejte přímo &lt;/ins&gt;do &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;YAML souboru. V nastavení repozitáře najdete sekci Secrets&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kde uložíte tokeny nebo klíče&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V workflow &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pak použijte jako $ secrets&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;NAZEV . Deploy na server může probíhat přes SSH&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;docker push nebo nahrání artefaktů na hosting&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité je také správně nastavit permissions – minimální oprávnění pro každý job&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;předešlo bezpečnostním rizikům&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;První workflow obvykle obsahuje tři sekce: name&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;on a jobs&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V sekci on určíte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kdy se má pipeline spustit. Pro základní CI stačí spustit na push &lt;/ins&gt;do &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;main &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;na pull requesty. Jobs definují&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co se má provést – typicky instalace závislostí&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spuštění testů a build&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité je zvolit vhodný runner, například ubuntu-latest&lt;/ins&gt;, a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;správně nastavit verzi jazyka&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;U &lt;/ins&gt;Node.js &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;použijete akci pro setup node&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;u Pythonu setup-python&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyhněte se pevným verzím balíčků &lt;/ins&gt;v &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lockfile&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud nechcete zbytečné konflikty při každém běhu&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro efektivní práci s GitHub Actions &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyplatí využít akce z tržiště&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale vždy kontrolujte jejich zdroj a verzi&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Preferujte oficiální akce od GitHubu nebo od výrobců technologií&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které používáte&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vlastní akce &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;můžete vytvořit&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud potřebujete specifickou logiku&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale pro většinu projektů stačí kombinace existujících&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Po každé změně workflow sledujte výstup v záložce Actions – tam uvidíte&lt;/ins&gt;, kde &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přesně pipeline selhala a jaké logy k tomu vedly. Trpělivé ladění &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;klíčem k tomu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby pipeline fungovala bez zbytečných přerušení&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na závěr si osvojte zvyk testovat rozhraní na reálných lidech&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nemusíte mít laboratoř – stačí, když požádáte kolegu, aby splnil konkrétní úkol, a pozorujete, kde váhá&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Zapisujte &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tyto momenty a opravujte je&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tento cyklus „navrhni – otestuj &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uprav&quot; je základem dobrého UX &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vývojáři ho často přeskočí&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pamatujte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že UI &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;UX nejsou jen o kráse&lt;/ins&gt;, ale &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;o tom&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby uživatel dosáhl cíle co nejrychleji a bez frustrace&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Když to pochopíte, vaše aplikace budou nejen funkční&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale i příjemné na používání&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejčastější chyby, které vývojáři dělají Jednou z nejčastějších chyb je ignorování prázdného místa. Mnoho vývojářů &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;snaží využít každý pixel&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale uživatelé potřebují prostor pro oči a pro pochopení struktury. Přidejte dostatečné mezery mezi prvky&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kolem textu i mezi odstavci. Nebojte se „prázdna&quot; – neznamená to ztrátu místa&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale přehlednost. Dalším problémem &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nekonzistence&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud tlačítka na jedné stránce vypadají jinak než na druhé&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uživatel se ztrácí&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vytvořte si jednoduchý design systém – alespoň sadu pravidel pro barvy, typografii&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;velikosti a chování prvků – &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;držte &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ho v celém projektu&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;If you liked this write-up and you would like to get even more info relating &lt;/ins&gt;to &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[http://Orasch.com/index&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;php?title=Rychlej%C5%A1%C3%AD_refaktorov%C3%A1n%C3%AD_k%C3%B3du_pomoc%C3%AD_vestav%C4%9Bn%C3%BDch_n%C3%A1stroj%C5%AF_IDE celý článek] kindly go &lt;/ins&gt;to &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the webpage&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>DannieCunneen1</name></author>
	</entry>
	<entry>
		<id>https://www.it-core.eu/wiki/index.php?title=Jak_Nastavit_CI/CD_Pipeline_S_GitHub_Actions&amp;diff=141503&amp;oldid=prev</id>
		<title>KristyPickles7 at 18:30, 21 August 2026</title>
		<link rel="alternate" type="text/html" href="https://www.it-core.eu/wiki/index.php?title=Jak_Nastavit_CI/CD_Pipeline_S_GitHub_Actions&amp;diff=141503&amp;oldid=prev"/>
		<updated>2026-08-21T18:30:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:30, 22 August 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Typické chyby&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které vás stojí čas i výkon Největší výkonnostní pastí &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zbytečné kopírování objektů při každé akci&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Redux vyžaduje neměnnost, ale to neznamená, že musíte deep-clone celý stav&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud měníte pouze jednu vlastnost, použijte spread operátor na úrovni, kterou měníte&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyhněte se &lt;/del&gt;také &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ukládání celých polí objektů do stavu, &lt;/del&gt;pokud &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je &lt;/del&gt;potřebujete &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jen přečíst. Místo toho &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je nechte v paměti &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;do Reduxu ukládejte pouze identifikátory. Při mapování stavu do props vybírejte jen to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co komponenta potřebuje, a používejte selektory, které se zapojí do memoizace&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Automatizace nasazení je jednou z prvních věcí, které byste měli ve svém &lt;/del&gt;projektu &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zavést, pokud chcete ušetřit čas a předejít chybám&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;GitHub Actions nabízí integrované řešení přímo v repozitáři&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže nemusíte provozovat žádný externí server&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro menší týmy i středně velké projekty je &lt;/del&gt;to &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obvykle nejpraktičtější volba&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;protože konfigurace je deklarativní a veškerá historie běhů zůstává přehledně na jednom místě.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Častou chybou bývá&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že vývojáři spoléhají pouze na příkaz console.log a vypisují si desítky hlášek &lt;/del&gt;do &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;konzole&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To je sice rychlé&lt;/del&gt;, ale &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;z dlouhodobého hlediska nepřehledné a často &lt;/del&gt;vám &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;unikne kontext, ve kterém k chybě došlo&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Místo toho &lt;/del&gt;si &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;osvojte používání podmíněných breakpointů &lt;/del&gt;– &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kliknete pravým tlačítkem na číslo řádku&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zvolíte Add conditional breakpoint &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zadáte podmínku&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která musí být splněna, aby se provádění zastavilo&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ušetříte tím spoustu času&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pokud se chyba projevuje jen při určité hodnotě proměnné (například když je pole prázdné nebo když je uživatel přihlášený)&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Prvním krokem k efektivnímu použití &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;správné členění &lt;/del&gt;store. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Rozdělte si Redux store &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;menší slice, každý s vlastními reducery a akcemí&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Například oddělte data uživatele&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obsah košíku a stav notifikací&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tím zajistíte lepší čitelnost a snazší testování. Vyhněte se obřím reducertům&lt;/del&gt;, které &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;řeší všechno&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Místo toho použijte funkci combineReducers a každý slice nechte žít samostatně. Tím &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyhnete častému problému&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kdy jedna chyba v jednom místě rozbije celou aplikaci&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Další užitečnou funkcí &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sledování hodnot výrazů v reálném čase&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V panelu Watch můžete přidat jakýkoliv výraz (například users&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;length nebo document.title) &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vidět&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mění při průchodu kódem&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;efektivnější než vpisovat console&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;log do každé větve&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pozor si dejte na to&lt;/del&gt;, že &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;u asynchronních funkcí &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hodnoty zobrazují v okamžiku zastavení&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže pokud potřebujete vidět stav po dokončení nějaké operace, budete muset nastavit breakpoint až za ní&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při testování chybových stavů postupujte stejně&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale mock funkce necháte vyhodit výjimku&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ověřte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že je dispatchována akce pro chybu&lt;/del&gt;, a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že stav aplikace zůstává konzistentní&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Častou chybou je testovat pouze šťastnou cestu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Přitom ošetření chyb je v Reduxu kritické&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;protože uživatel musí vidět&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že něco selhalo&lt;/del&gt;, a aplikace &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se nesmí zhroutit&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dále si dejte pozor &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to, abyste nemockovali příliš mnoho&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud mockujete i samotný dispatch&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ztrácíte kontrolu nad tím, co testujete&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při výběru IDE &lt;/del&gt;pro &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Python nejde o to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které je nejlepší&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale které nejlépe sedne vašemu stylu práce&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte tím&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že si ujasníte&lt;/del&gt;, co &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;od nástroje skutečně potřebujete&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud píšete skripty pro automatizaci nebo analýzu dat&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;často &lt;/del&gt;stačí &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;lehký editor s integrovaným terminálem. Pokud vyvíjíte větší aplikace s frameworky, oceníte pokročilé ladění&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;správu virtuálních prostředí &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;integraci s verzovacími systémy. Nenechte se zlákat množstvím funkcí – klíčové je, aby nástroj zrychloval vaši práci, ne ji komplikoval&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nakonec se rozhodněte &lt;/del&gt;podle &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;toho&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co jste si ověřili v praxi&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ideální je&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;když si vyberete jeden hlavní nástroj &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jeden záložní pro rychlé úpravy&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyhnete se tak situaci&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kdy budete muset kvůli jednomu skriptu otevírat těžké &lt;/del&gt;prostředí. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pamatujte&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že žádné IDE nenahradí znalost příkazů a syntaxe jazyka – &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to jen nástroj&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který vám má usnadnit práci, ne za vás myslet&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Refaktorování kódu je nedílnou součástí vývoje&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale často ho vnímáme jako zdlouhavou a nudnou činnost. Mnoho vývojářů stále ručně přejmenovává proměnné&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přesouvá metody nebo mění signatury funkcí&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přitom moderní vývojová prostředí nabízejí celou řadu vestavěných nástrojů&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které tyto operace výrazně urychlí &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hlavně eliminují chyby vzniklé při ručním zásahu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Stačí se naučit pár klávesových zkratek a pochopit&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co všechno IDE umí&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Pozor také &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak IDE spravuje virtuální prostředí&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dobrý nástroj by měl umožnit vytvořit nové prostředí jedním kliknutím a automaticky ho aktivovat při spuštění projektu&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud tuto funkci nemá&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;snadno &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stane, že balíčky instalujete do globálního prostředí &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;po čase narazíte na konflikty verzí&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To je jeden z nejčastějších zdrojů frustrace&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přitom se mu dá snadno předejít právě správným výběrem&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při psaní příkazů se vyhněte tvrdě zakódovaným tajemstvím&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jako jsou API klíče nebo hesla. GitHub Actions umožňuje ukládat je do sekce Secrets v nastavení repozitáře a v souboru &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pak odkazujete přes $ secrets&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;NAZEV &lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tím se hodnoty nezobrazí v logu a můžete je měnit bez úpravy kódu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Klíčové je &lt;/ins&gt;také &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;správně nastavit oprávnění tokenu – &lt;/ins&gt;pokud potřebujete &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nasadit na produkci, vytvořte &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;osobní přístupový token s minimálními právy &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;uložte ho jako secret&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nikdy nepoužívejte výchozí GITHUB_TOKEN pro akce s vyššími oprávněními&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na závěr si osvojte jednu užitečnou návyk: pište si ke každému &lt;/ins&gt;projektu &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;soubor .dockerignore. Do něj vložte složky jako node_modules nebo &lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;git&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby se při buildu nekopírovaly zbytečné soubory&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nejenže &lt;/ins&gt;to &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zrychlí build&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale také zabrání tomu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby se &lt;/ins&gt;do &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obrazu dostaly citlivé údaje z vašeho lokálního prostředí&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Docker není kouzlo&lt;/ins&gt;, ale &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;když se naučíte jeho základní principy, ušetří &lt;/ins&gt;vám &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;hodiny práce při nasazování aplikací&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyzkoušejte &lt;/ins&gt;si &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to na malém projektu &lt;/ins&gt;– &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vytvořte si vlastní obraz&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spusťte ho &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;postupně přidávejte další funkce&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jako jsou svazky nebo síťová propojení mezi kontejnery&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Za pár dní zjistíte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že bez kontejnerů už nechcete pracovat&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Typickou chybou &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spoléhat na skutečné API volání nebo na globální &lt;/ins&gt;store. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Takový test je pomalý a náchylný &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;selhání z důvodu síťových výpadků&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Další častou chybou je zapomenout na asynchronní povahu thunku – test skončí dřív&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;než thunk stihne dokončit&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Řešením je použít async/await nebo zpětné volání&lt;/ins&gt;, které &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;počká na dokončení&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;V neposlední řadě &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vyvarujte testování reducerů přes store – to je integrační test&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který nepotřebujete pro pokrytí čisté logiky&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jak si vytvořit první kontejner a nespálit se Základním stavebním kamenem &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;soubor Dockerfile&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ten popisuje, jak se má výsledný obraz vytvořit&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte jednoduchým příkladem: vezměte oficiální obraz jazyka Python, nakopírujte do něj svůj skript &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nastavte příkaz&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;má spustit&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dodržet pořadí instrukcí&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud totiž změníte pouze kód aplikace, Docker využije cache a build proběhne rychle&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud ale nejprve zkopírujete celý projekt a teprve poté instalujete závislosti, každá změna v kódu způsobí&lt;/ins&gt;, že se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;závislosti instalují znovu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;což je pomalé a frustrující&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jakmile máte Docker v provozu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;začněte s jednoduchým projektem&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vytvořte složku&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;do ní vložte soubor s názvem Dockerfile a do něj napište následující řádky: FROM node:20-alpine, WORKDIR /app, COPY . .&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;RUN npm install &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CMD [&quot;node&quot;, &quot;server.js&quot;]&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tento Dockerfile říká Dockeru, aby použil oficiální obraz Node&lt;/ins&gt;.&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;js&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nastavil pracovní složku&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zkopíroval soubory&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nainstaloval závislosti &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;spustil server. Poté v terminálu spusťte docker build -t moje-&lt;/ins&gt;aplikace . &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;(tečka &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;konci je důležitá – označuje aktuální složku). Po úspěšném buildu spustíte kontejner příkazem docker run -p 3000:3000 moje-aplikace&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Parametr -p mapuje port z kontejneru na váš počítač&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takže aplikaci otevřete v prohlížeči na adrese localhost:3000&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Když se řekne Docker, mnoho začátečníků si představí složitý nástroj &lt;/ins&gt;pro &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;správce sítí. Opak je pravdou – Docker je v podstatě způsob&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak zabalit aplikaci i všechny její závislosti do jednoho přenosného balíčku&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kterému se říká kontejner&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Místo instalace deseti různých verzí knihoven do systému si vytvoříte obraz&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který obsahuje přesně to&lt;/ins&gt;, co &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vaše aplikace potřebuje&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tento obraz pak můžete spustit kdekoli, kde je nainstalovaný Docker – na notebooku&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;serveru i v cloudu. Pro začátek &lt;/ins&gt;stačí &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pochopit tři základní pojmy: obraz&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kontejner &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dockerfile&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Základní workflow začíná souborem ve složce .github/workflows. Název souboru si zvolte &lt;/ins&gt;podle &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;účelu&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;například ci.yml&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na začátku definujete události&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které pipeline spouští – nejčastěji push do větve main &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pull requesty&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dále specifikujete Runner&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tedy &lt;/ins&gt;prostředí&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;, na kterém se úlohy vykonávají&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pro JavaScript a Python stačí obvykle ubuntu-latest&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale pokud potřebujete Windows nebo macOS, GitHub nabízí i tyto varianty. Vždy &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vhodné pinout verzi runneru&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abyste předešli nečekaným změnám ve výchozím prostředí&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Co se týče praktických rad&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vždy si ověřte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že obraz&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který stahujete&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je oficiální &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aktualizovaný&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Na veřejných registrech najdete tisíce obrazů&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale ne všechny jsou udržované&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Spolehněte se &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ty&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které mají jasný popis a jsou spravované přímo dodavatelem technologie&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dále se vyhněte používání tagu latest pro produkci&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;I když se to zdá pohodlné&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;takový obraz &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;může ze dne na den změnit &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;vaše aplikace pak přestane fungovat z ničeho nic&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Raději používejte konkrétní verze&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;i když to znamená občasné manuální aktualizace&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>KristyPickles7</name></author>
	</entry>
	<entry>
		<id>https://www.it-core.eu/wiki/index.php?title=Jak_Nastavit_CI/CD_Pipeline_S_GitHub_Actions&amp;diff=141454&amp;oldid=prev</id>
		<title>MichelStover7 at 18:28, 21 August 2026</title>
		<link rel="alternate" type="text/html" href="https://www.it-core.eu/wiki/index.php?title=Jak_Nastavit_CI/CD_Pipeline_S_GitHub_Actions&amp;diff=141454&amp;oldid=prev"/>
		<updated>2026-08-21T18:28:19Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:28, 22 August 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Další užitečnou funkcí je sledování hodnot výrazů v reálném čase. V panelu Watch můžete přidat jakýkoliv výraz (například users.length nebo document.title) a vidět, jak se mění při průchodu kódem. To je efektivnější než vpisovat console.log do každé větve. Pozor si dejte na to, že u asynchronních funkcí se hodnoty zobrazují v okamžiku zastavení, takže pokud potřebujete vidět stav po dokončení nějaké operace, budete muset nastavit breakpoint až za ní.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mezi časté chyby patří zapomenutí na podmínky spuštění. Pokud máte workflow s více joby&lt;/del&gt;, ale &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;některý z nich je určen jen pro specifickou větev, použijte if podmínku&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jinak se nasazení spustí i při pushi do feature větve&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;což může vést k neočekávaným změnám. Další pastí &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;špatně nastavený caching. Bez cache se každý běh spouští od nuly, což prodlužuje dobu pipeline i u malých projektů. GitHub Actions poskytuje &lt;/del&gt;akce pro &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;cache – stačí správně určit klíč podle hash souboru se závislostmi&lt;/del&gt;, a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pak se instalace opakuje jen při změně závislostí&lt;/del&gt;.&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Docker Compose &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;další krok&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který výrazně zjednodušuje život. Místo dlouhých příkazů s mnoha parametry napíšete soubor docker-compose.yml&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ve kterém definujete služby&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;sítě &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;svazky&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Typickou chybou je definovat databázi a webovou aplikaci jako dva samostatné kontejnery, ale připojit je k sobě přes síť až po spuštění. Compose to zvládne automaticky, pokud obě služby umístíte do stejného souboru. Pozor ale &lt;/del&gt;na to, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že každý kontejner má vlastní souborový systém&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Jakmile v něm smažete data, jsou pryč. Proto vždy používejte takzvané svazky (volumes) pro data&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;která chcete uchovat&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jinak o ně přijdete při každém restartu&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Co se týče praktických rad, vždy si ověřte, že obraz, který stahujete&lt;/del&gt;, je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;oficiální a aktualizovaný. Na veřejných registrech najdete tisíce obrazů&lt;/del&gt;, ale &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ne všechny jsou udržované&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Spolehněte se na ty&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které mají jasný popis a jsou spravované přímo dodavatelem technologie&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dále se vyhněte používání tagu latest &lt;/del&gt;pro &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;produkci&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;I když se to zdá pohodlné, takový obraz se může ze dne na den změnit a vaše &lt;/del&gt;aplikace &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pak přestane fungovat z ničeho nic. Raději používejte konkrétní verze&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;i když to znamená občasné manuální aktualizace.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Když se řekne databáze&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;většina vývojářů si představí tabulky, řádky &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;SQL dotazy&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Relační databáze jsou osvědčeným standardem, ale ne pro každý projekt jsou tou nejlepší volbou. NoSQL databáze nabízí jiný způsob ukládání dat, který může být v některých případech výrazně efektivnější. Než &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale pustíte do jejich implementace&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;je důležité pochopit&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kdy dávají smysl a kdy naopak přinesou více problémů než užitku&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Nakonec, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;běžnou chybou &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ignorování velikosti obrazů. Každý obraz&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který použijete, zabírá místo na disku &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;při přenosu mezi registry spotřebovává čas a data&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Snažte &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;používat minimalistické základy, jako jsou varianty s označením -alpine, a kombinovat příkazy pro instalaci balíčků do jednoho řádku &lt;/del&gt;tak, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abyste minimalizovali počet vrstev&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Tím dosáhnete menších obrazů &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rychlejšího nasazení. Až toto zvládnete, můžete se pustit do pokročilejších témat, jako &lt;/del&gt;je &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;orchestrace nebo bezpečnostní skenování. Ale pro začátek stačí&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;když budete rozumět tomu&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co děláte, a budete vědět, kde hledat, když se něco pokazí&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Typickým případem&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kdy zvolit NoSQL, je ukládání uživatelských profilů&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;produktů v e-shopu &lt;/del&gt;nebo &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;obsahu pro analytické nástroje. Představte si&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že máte v aplikaci položky&lt;/del&gt;, které &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mají různé atributy – jeden produkt má barvu &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;velikost&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jiný jen hmotnost. V relační databázi byste museli vytvářet mnoho prázdných sloupců nebo propojovat pomocné tabulky. V dokumentové NoSQL databázi jednoduše uložíte každý produkt jako JSON dokument s libovolnými klíči&lt;/del&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Důležité je &lt;/del&gt;také &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;myslet &lt;/del&gt;na to, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že commit zprávy jsou určeny lidem, ne strojům&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyhněte se příliš technickému žargonu, který &lt;/del&gt;by &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;neznalý kolega nemusel pochopit. Současně ale nepopisujte každý řádek kódu – to je zbytečné. Zaměřte se na záměr &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;na dopad&lt;/del&gt;. Pokud se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;někdo za půl roku zeptá&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;proč je v kódu určité řešení, měl by dostat odpověď právě z vaší zprávy. Pište proto s ohledem na budoucí čtenáře, kterými budete s největší pravděpodobností i vy sami.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;SQL injection není problém, který by se dal vyřešit jednou provždy. Vyžaduje průběžnou pozornost &lt;/del&gt;a &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kódování s ohledem &lt;/del&gt;na &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bezpečnost&lt;/del&gt;. &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při každém novém dotazu se zeptejte, zda obsahuje uživatelský vstup&lt;/del&gt;, &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;a pokud ano, použijte parametrizaci. Pravidelně aktualizujte databázové ovladače a frameworky, které často obsahují opravy známých zranitelností. Investice do prevence &lt;/del&gt;se &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mnohonásobně vrátí, protože náklady na řešení úniku dat jsou obvykle výrazně vyšší než čas strávený psaním bezpečného kódu&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Typické chyby, které vás stojí čas i výkon Největší výkonnostní pastí je zbytečné kopírování objektů při každé akci. Redux vyžaduje neměnnost, ale to neznamená, že musíte deep-clone celý stav. Pokud měníte pouze jednu vlastnost, použijte spread operátor na úrovni, kterou měníte. Vyhněte se také ukládání celých polí objektů do stavu, pokud je potřebujete jen přečíst. Místo toho si je nechte v paměti a do Reduxu ukládejte pouze identifikátory. Při mapování stavu do props vybírejte jen to, co komponenta potřebuje, a používejte selektory, které se zapojí do memoizace.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Automatizace nasazení je jednou z prvních věcí, které byste měli ve svém projektu zavést, pokud chcete ušetřit čas a předejít chybám. GitHub Actions nabízí integrované řešení přímo v repozitáři, takže nemusíte provozovat žádný externí server. Pro menší týmy i středně velké projekty je to obvykle nejpraktičtější volba, protože konfigurace je deklarativní a veškerá historie běhů zůstává přehledně na jednom místě.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Častou chybou bývá, že vývojáři spoléhají pouze na příkaz console.log a vypisují si desítky hlášek do konzole. To je sice rychlé, ale z dlouhodobého hlediska nepřehledné a často vám unikne kontext, ve kterém k chybě došlo. Místo toho si osvojte používání podmíněných breakpointů – kliknete pravým tlačítkem na číslo řádku, zvolíte Add conditional breakpoint a zadáte podmínku, která musí být splněna, aby se provádění zastavilo. Ušetříte tím spoustu času, pokud se chyba projevuje jen při určité hodnotě proměnné (například když je pole prázdné nebo když je uživatel přihlášený).&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Prvním krokem k efektivnímu použití je správné členění store. Rozdělte si Redux store na menší slice, každý s vlastními reducery a akcemí. Například oddělte data uživatele, obsah košíku a stav notifikací. Tím zajistíte lepší čitelnost a snazší testování. Vyhněte se obřím reducertům, které řeší všechno. Místo toho použijte funkci combineReducers a každý slice nechte žít samostatně. Tím se vyhnete častému problému, kdy jedna chyba v jednom místě rozbije celou aplikaci.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;/ins&gt;Další užitečnou funkcí je sledování hodnot výrazů v reálném čase. V panelu Watch můžete přidat jakýkoliv výraz (například users.length nebo document.title) a vidět, jak se mění při průchodu kódem. To je efektivnější než vpisovat console.log do každé větve. Pozor si dejte na to, že u asynchronních funkcí se hodnoty zobrazují v okamžiku zastavení, takže pokud potřebujete vidět stav po dokončení nějaké operace, budete muset nastavit breakpoint až za ní.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při testování chybových stavů postupujte stejně&lt;/ins&gt;, ale &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mock funkce necháte vyhodit výjimku&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Ověřte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;dispatchována &lt;/ins&gt;akce pro &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;chybu&lt;/ins&gt;, a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že stav aplikace zůstává konzistentní. Častou chybou je testovat pouze šťastnou cestu&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Přitom ošetření chyb &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;v Reduxu kritické&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;protože uživatel musí vidět&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že něco selhalo&lt;/ins&gt;, a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aplikace se nesmí zhroutit&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dále si dejte pozor &lt;/ins&gt;na to, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;abyste nemockovali příliš mnoho&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud mockujete i samotný dispatch&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ztrácíte kontrolu nad tím&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co testujete&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Při výběru IDE pro Python nejde o to&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nejlepší&lt;/ins&gt;, ale &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;které nejlépe sedne vašemu stylu práce&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Začněte tím, že si ujasníte&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co od nástroje skutečně potřebujete&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud píšete skripty &lt;/ins&gt;pro &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;automatizaci nebo analýzu dat, často stačí lehký editor s integrovaným terminálem&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pokud vyvíjíte větší &lt;/ins&gt;aplikace &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;s frameworky&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;oceníte pokročilé ladění&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;správu virtuálních prostředí &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;integraci s verzovacími systémy&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Nenechte &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;zlákat množstvím funkcí – klíčové je&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;aby nástroj zrychloval vaši práci&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ne ji komplikoval&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Nakonec &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;se rozhodněte podle toho&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co jste si ověřili v praxi. Ideální &lt;/ins&gt;je, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;když si vyberete jeden hlavní nástroj &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jeden záložní pro rychlé úpravy&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Vyhnete &lt;/ins&gt;se tak &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;situaci&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kdy budete muset kvůli jednomu skriptu otevírat těžké prostředí&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pamatujte, že žádné IDE nenahradí znalost příkazů &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;syntaxe jazyka – &lt;/ins&gt;je &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;to jen nástroj&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;který vám má usnadnit práci&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ne za vás myslet&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Refaktorování kódu je nedílnou součástí vývoje&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ale často ho vnímáme jako zdlouhavou a nudnou činnost. Mnoho vývojářů stále ručně přejmenovává proměnné&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přesouvá metody &lt;/ins&gt;nebo &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mění signatury funkcí&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přitom moderní vývojová prostředí nabízejí celou řadu vestavěných nástrojů&lt;/ins&gt;, které &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tyto operace výrazně urychlí a hlavně eliminují chyby vzniklé při ručním zásahu. Stačí se naučit pár klávesových zkratek &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;pochopit&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;co všechno IDE umí&lt;/ins&gt;.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Pozor &lt;/ins&gt;také na to, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;jak IDE spravuje virtuální prostředí&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Dobrý nástroj &lt;/ins&gt;by &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;měl umožnit vytvořit nové prostředí jedním kliknutím &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;automaticky ho aktivovat při spuštění projektu&lt;/ins&gt;. Pokud &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;tuto funkci nemá, snadno &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;stane&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;že balíčky instalujete do globálního prostředí &lt;/ins&gt;a &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;po čase narazíte &lt;/ins&gt;na &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;konflikty verzí&lt;/ins&gt;. &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;To je jeden z nejčastějších zdrojů frustrace&lt;/ins&gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;přitom &lt;/ins&gt;se &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;mu dá snadno předejít právě správným výběrem&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>MichelStover7</name></author>
	</entry>
	<entry>
		<id>https://www.it-core.eu/wiki/index.php?title=Jak_Nastavit_CI/CD_Pipeline_S_GitHub_Actions&amp;diff=140882&amp;oldid=prev</id>
		<title>DinaStringfield: Created page with &quot;Další užitečnou funkcí je sledování hodnot výrazů v reálném čase. V panelu Watch můžete přidat jakýkoliv výraz (například users.length nebo document.title) a vidět, jak se mění při průchodu kódem. To je efektivnější než vpisovat console.log do každé větve. Pozor si dejte na to, že u asynchronních funkcí se hodnoty zobrazují v okamžiku zastavení, takže pokud potřebujete vidět stav po dokončení nějaké operace, budete muset nasta...&quot;</title>
		<link rel="alternate" type="text/html" href="https://www.it-core.eu/wiki/index.php?title=Jak_Nastavit_CI/CD_Pipeline_S_GitHub_Actions&amp;diff=140882&amp;oldid=prev"/>
		<updated>2026-08-21T17:53:54Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Další užitečnou funkcí je sledování hodnot výrazů v reálném čase. V panelu Watch můžete přidat jakýkoliv výraz (například users.length nebo document.title) a vidět, jak se mění při průchodu kódem. To je efektivnější než vpisovat console.log do každé větve. Pozor si dejte na to, že u asynchronních funkcí se hodnoty zobrazují v okamžiku zastavení, takže pokud potřebujete vidět stav po dokončení nějaké operace, budete muset nasta...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Další užitečnou funkcí je sledování hodnot výrazů v reálném čase. V panelu Watch můžete přidat jakýkoliv výraz (například users.length nebo document.title) a vidět, jak se mění při průchodu kódem. To je efektivnější než vpisovat console.log do každé větve. Pozor si dejte na to, že u asynchronních funkcí se hodnoty zobrazují v okamžiku zastavení, takže pokud potřebujete vidět stav po dokončení nějaké operace, budete muset nastavit breakpoint až za ní.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Mezi časté chyby patří zapomenutí na podmínky spuštění. Pokud máte workflow s více joby, ale některý z nich je určen jen pro specifickou větev, použijte if podmínku. Jinak se nasazení spustí i při pushi do feature větve, což může vést k neočekávaným změnám. Další pastí je špatně nastavený caching. Bez cache se každý běh spouští od nuly, což prodlužuje dobu pipeline i u malých projektů. GitHub Actions poskytuje akce pro cache – stačí správně určit klíč podle hash souboru se závislostmi, a pak se instalace opakuje jen při změně závislostí.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Docker Compose je další krok, který výrazně zjednodušuje život. Místo dlouhých příkazů s mnoha parametry napíšete soubor docker-compose.yml, ve kterém definujete služby, sítě a svazky. Typickou chybou je definovat databázi a webovou aplikaci jako dva samostatné kontejnery, ale připojit je k sobě přes síť až po spuštění. Compose to zvládne automaticky, pokud obě služby umístíte do stejného souboru. Pozor ale na to, že každý kontejner má vlastní souborový systém. Jakmile v něm smažete data, jsou pryč. Proto vždy používejte takzvané svazky (volumes) pro data, která chcete uchovat, jinak o ně přijdete při každém restartu.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Co se týče praktických rad, vždy si ověřte, že obraz, který stahujete, je oficiální a aktualizovaný. Na veřejných registrech najdete tisíce obrazů, ale ne všechny jsou udržované. Spolehněte se na ty, které mají jasný popis a jsou spravované přímo dodavatelem technologie. Dále se vyhněte používání tagu latest pro produkci. I když se to zdá pohodlné, takový obraz se může ze dne na den změnit a vaše aplikace pak přestane fungovat z ničeho nic. Raději používejte konkrétní verze, i když to znamená občasné manuální aktualizace.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Když se řekne databáze, většina vývojářů si představí tabulky, řádky a SQL dotazy. Relační databáze jsou osvědčeným standardem, ale ne pro každý projekt jsou tou nejlepší volbou. NoSQL databáze nabízí jiný způsob ukládání dat, který může být v některých případech výrazně efektivnější. Než se ale pustíte do jejich implementace, je důležité pochopit, kdy dávají smysl a kdy naopak přinesou více problémů než užitku.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Nakonec, běžnou chybou je ignorování velikosti obrazů. Každý obraz, který použijete, zabírá místo na disku a při přenosu mezi registry spotřebovává čas a data. Snažte se používat minimalistické základy, jako jsou varianty s označením -alpine, a kombinovat příkazy pro instalaci balíčků do jednoho řádku tak, abyste minimalizovali počet vrstev. Tím dosáhnete menších obrazů a rychlejšího nasazení. Až toto zvládnete, můžete se pustit do pokročilejších témat, jako je orchestrace nebo bezpečnostní skenování. Ale pro začátek stačí, když budete rozumět tomu, co děláte, a budete vědět, kde hledat, když se něco pokazí.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Typickým případem, kdy zvolit NoSQL, je ukládání uživatelských profilů, produktů v e-shopu nebo obsahu pro analytické nástroje. Představte si, že máte v aplikaci položky, které mají různé atributy – jeden produkt má barvu a velikost, jiný jen hmotnost. V relační databázi byste museli vytvářet mnoho prázdných sloupců nebo propojovat pomocné tabulky. V dokumentové NoSQL databázi jednoduše uložíte každý produkt jako JSON dokument s libovolnými klíči.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;Důležité je také myslet na to, že commit zprávy jsou určeny lidem, ne strojům. Vyhněte se příliš technickému žargonu, který by neznalý kolega nemusel pochopit. Současně ale nepopisujte každý řádek kódu – to je zbytečné. Zaměřte se na záměr a na dopad. Pokud se někdo za půl roku zeptá, proč je v kódu určité řešení, měl by dostat odpověď právě z vaší zprávy. Pište proto s ohledem na budoucí čtenáře, kterými budete s největší pravděpodobností i vy sami.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;SQL injection není problém, který by se dal vyřešit jednou provždy. Vyžaduje průběžnou pozornost a kódování s ohledem na bezpečnost. Při každém novém dotazu se zeptejte, zda obsahuje uživatelský vstup, a pokud ano, použijte parametrizaci. Pravidelně aktualizujte databázové ovladače a frameworky, které často obsahují opravy známých zranitelností. Investice do prevence se mnohonásobně vrátí, protože náklady na řešení úniku dat jsou obvykle výrazně vyšší než čas strávený psaním bezpečného kódu.&lt;/div&gt;</summary>
		<author><name>DinaStringfield</name></author>
	</entry>
</feed>