Skip to content

Commit 92a87b0

Browse files
authored
Merge pull request #17 from wendev27/checkpoint-11-docker-hub-continuous-deployment-and-deployment-pipelines
docs(checkpoint): complete checkpoint 11 - Docker Hub Continuous Deployment & Deployment Pipelines
2 parents b4cca5b + 793cf18 commit 92a87b0

2 files changed

Lines changed: 303 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ This repository was created to:
6161
- [x] GitHub Actions
6262
- [x] Automated Testing
6363
- [x] Continuous Integration
64-
- [ ] Secrets Management
65-
- [ ] Continuous Deployment
66-
- [ ] Deployment Pipelines
64+
- [x] Secrets Management
65+
- [x] Continuous Deployment
66+
- [x] Deployment Pipelines
6767

6868
---
6969

Lines changed: 300 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,300 @@
1+
Checkpoint 11 — Docker Hub, Continuous Deployment & Deployment Pipelines
2+
Objective
3+
4+
Understand how modern deployment pipelines automatically build, store, and distribute applications using GitHub Actions, Docker Hub, and secure credentials.
5+
6+
This checkpoint introduces the foundations of Continuous Deployment (CD) and demonstrates how CI pipelines evolve into deployment pipelines.
7+
8+
Why this checkpoint matters
9+
10+
Before this checkpoint:
11+
12+
Write code
13+
14+
Build Docker image manually
15+
16+
Tag image manually
17+
18+
Push image manually
19+
20+
Deploy manually
21+
22+
After this checkpoint:
23+
24+
Write code
25+
26+
git push
27+
28+
GitHub Actions starts
29+
30+
Run tests
31+
32+
Build Docker image
33+
34+
Authenticate securely
35+
36+
Push image to Docker Hub
37+
38+
Deployment artifact is ready
39+
40+
This is the foundation of:
41+
42+
Continuous Deployment (CD)
43+
Deployment pipelines
44+
Cloud-native development
45+
Infrastructure automation
46+
Kubernetes
47+
AWS and cloud platforms
48+
Production releases
49+
Main Questions
50+
51+
We asked:
52+
53+
How are Docker images stored?
54+
What is Docker Hub?
55+
Why do registries exist?
56+
How can GitHub authenticate securely?
57+
What are GitHub Secrets?
58+
How do CI pipelines become deployment pipelines?
59+
How does a server receive new versions of an application?
60+
Step 1 — Create a Docker Hub account
61+
62+
We created a Docker Hub account and connected it with GitHub.
63+
64+
Docker Hub acts as:
65+
66+
GitHub → source code
67+
68+
Docker Hub → container images
69+
70+
GitHub stores:
71+
72+
app.js
73+
Dockerfile
74+
README.md
75+
76+
Docker Hub stores:
77+
78+
my-first-image:latest
79+
Step 2 — Tag the image
80+
81+
Local image:
82+
83+
docker images
84+
85+
Result:
86+
87+
my-first-image
88+
89+
Tagged image:
90+
91+
docker tag my-first-image wendev27/my-first-image
92+
93+
Mental model:
94+
95+
Before:
96+
97+
my-first-image
98+
99+
After:
100+
101+
wendev27/my-first-image
102+
Step 3 — Push to Docker Hub
103+
104+
Command:
105+
106+
docker push wendev27/my-first-image
107+
108+
Docker uploaded multiple layers:
109+
110+
Layer 1
111+
Layer 2
112+
Layer 3
113+
...
114+
115+
Important discovery:
116+
117+
Docker does not re-upload everything every time.
118+
119+
It only uploads:
120+
121+
new layers
122+
changed layers
123+
124+
Unchanged layers are reused.
125+
126+
Step 4 — Secure credentials with GitHub Secrets
127+
128+
Repository settings:
129+
130+
Settings
131+
132+
Secrets and variables
133+
134+
Actions
135+
136+
Created secrets:
137+
138+
DOCKER_USERNAME
139+
140+
DOCKER_TOKEN
141+
142+
Secrets allow GitHub Actions to authenticate without exposing passwords.
143+
144+
Rule learned:
145+
146+
Never store passwords, API keys, or tokens inside code.
147+
148+
Use GitHub Secrets instead.
149+
150+
Examples:
151+
152+
Docker tokens
153+
MongoDB connection strings
154+
Supabase keys
155+
Vercel tokens
156+
AWS credentials
157+
API keys
158+
Step 5 — Extend the GitHub Actions workflow
159+
160+
Workflow:
161+
162+
- name: Log in to Docker Hub
163+
uses: docker/login-action@v3
164+
with:
165+
username: ${{ secrets.DOCKER_USERNAME }}
166+
password: ${{ secrets.DOCKER_TOKEN }}
167+
168+
- name: Push Docker image
169+
run: |
170+
docker tag my-first-image wendev27/my-first-image:latest
171+
docker push wendev27/my-first-image:latest
172+
173+
GitHub successfully:
174+
175+
authenticated with Docker Hub
176+
tagged the image
177+
pushed the image automatically
178+
hid the credentials inside the logs
179+
180+
The workflow logs prove that GitHub built the image and pushed it to Docker Hub automatically.
181+
182+
Complete Deployment Pipeline
183+
Developer laptop
184+
185+
git push
186+
187+
GitHub receives code
188+
189+
Create Ubuntu runner
190+
191+
Checkout repository
192+
193+
Install dependencies
194+
195+
Run tests
196+
197+
Build Docker image
198+
199+
Authenticate with Docker Hub
200+
201+
Push image
202+
203+
Docker registry
204+
205+
Production server
206+
207+
Users
208+
Continuous Integration vs Continuous Deployment
209+
Concept Purpose
210+
Continuous Integration (CI) Verify code automatically
211+
Continuous Deployment (CD) Deliver software automatically
212+
Docker Hub Store deployment artifacts
213+
GitHub Secrets Protect credentials
214+
Deployment Pipeline Move software toward production
215+
Mental Models Built
216+
Concept Mental Model
217+
Docker Hub GitHub for containers
218+
Registry Warehouse
219+
Docker image Deployment package
220+
Secret Encrypted vault
221+
Pipeline Automated factory
222+
Continuous Deployment Automatic delivery system
223+
Commands Learned
224+
225+
Tag image:
226+
227+
docker tag my-first-image wendev27/my-first-image
228+
229+
Push image:
230+
231+
docker push wendev27/my-first-image
232+
233+
List local images:
234+
235+
docker images
236+
237+
Create GitHub secrets:
238+
239+
Repository Settings
240+
241+
Secrets and variables
242+
Biggest Lesson
243+
244+
Continuous Deployment is not magic.
245+
246+
Modern software companies automate:
247+
248+
testing
249+
validation
250+
image creation
251+
authentication
252+
artifact storage
253+
deployment preparation
254+
255+
using pipelines.
256+
257+
GitHub Actions is not just a CI tool.
258+
259+
It is an automated software factory.
260+
261+
Connection to Future Topics
262+
GitHub Actions
263+
264+
Continuous Integration
265+
266+
Docker Hub
267+
268+
Continuous Deployment
269+
270+
AWS
271+
272+
Kubernetes
273+
274+
Production infrastructure
275+
Questions Asked During the Lab
276+
Can Docker store images like GitHub stores code?
277+
Why do Docker images need a registry?
278+
How does GitHub authenticate safely?
279+
Why do we need GitHub Secrets?
280+
Can GitHub deploy automatically?
281+
How do cloud platforms receive Docker images?
282+
Does Vercel build containers internally?
283+
What happens after docker push?
284+
Biggest Discovery
285+
286+
The workflow you built is no longer just a test pipeline.
287+
288+
It has become a deployment pipeline:
289+
290+
Code
291+
292+
Tests
293+
294+
Container
295+
296+
Registry
297+
298+
Production
299+
300+
And that's the exact architecture behind modern cloud systems used by companies like Netflix, Spotify, Uber, and thousands of SaaS platforms. 🚀

0 commit comments

Comments
 (0)