Today I Learned

[til] 220319 - publishing website

yuull 2022. 3. 20. 01:29

๐Ÿ˜ถ‍๐ŸŒซ๏ธ ์˜ค๋Š˜ ํ•œ ์ผ ๐Ÿ˜ถ‍๐ŸŒซ๏ธ

โ˜‘๏ธ ์ฝ”์ฝ”์•„ํ†ก ํด๋ก ์ฝ”๋”ฉ - publishing website

BOJ - ์ •๋ ฌ 

โ˜‘๏ธ ์ด์ฝ”ํ…Œ ์ •๋ ฌ ๊ธฐ๋ณธ๋ฌธ์ œ ํ’€๊ธฐ

โ˜‘๏ธ ํ€ต ์ •๋ ฌ ๋ณต์Šต


Publishing Website

git branch: master branch ์—์„œ ๋‹ค๋ฅธ feature์„ ๋”ํ•˜๋Š” ์ปค๋ฐ‹๋“ค. (์ƒˆ๋กœ์šด ๊ธฐ๋Šฅ์„ ๋‹ค๋ฃจ๊ธฐ ์œ„ํ•ด ์ƒˆ๋กœ์šด branch ์ƒ์„ฑ)

์ถœ์ฒ˜ https://velog.io/@gil0127/Git-merge-Git-rebase

์ดˆ๋ก์ƒ‰์ด git branch.

 

github desktop์—์„œ current branch๋ฅผ ๋งˆ์Šคํ„ฐ๊ฐ€ ์•„๋‹Œ ๋ณ„๋„์˜ branch [A]๋กœ ๋„์›Œ๋†“๊ณ 

vs code ์—์„œ ์ฝ”๋“œ๋ฅผ ์ƒˆ๋กœ ์ž‘์„ฑํ•˜๊ฑฐ๋‚˜ ๊ธฐ์กด ์ฝ”๋“œ๋ฅผ ์ˆ˜์ • + commit ํ•˜๋ฉด,

master branch ์—๋Š” ์ ์šฉ์ด ์•ˆ ๋˜๊ณ  (๋ฌผ๋ก  ์ ์šฉํ•˜๋„๋ก ์„ ํƒ ๊ฐ€๋Šฅ), current branch์ธ branch [A] ์—๋งŒ ์ปค๋ฐ‹์ด ๋ณด์ธ๋‹ค.

 

git merge: ๋งˆ์Šคํ„ฐ๊ฐ€ ์•„๋‹Œ branch ์—์„œ ํ•œ ์ปค๋ฐ‹๋“ค์„ master branch ์— merge.

→ merge ํ•˜๊ธฐ ์ „์—๋Š” ๋งˆ์Šคํ„ฐ๊ฐ€ ์•„๋‹Œ branch ์—์„œ๋งŒ ๋ณด์ด๋˜ ๋ณ€ํ™”๊ฐ€ master branch ์—๋„ ๋ณด์ด๊ฒŒ ๋œ๋‹ค.

→ master branch์™€ ๋งˆ์Šคํ„ฐ๊ฐ€ ์•„๋‹Œ branch๊ฐ€ ๋˜‘๊ฐ™์•„์ง.

 

how to publish on github pages:

1. github desktop์—์„œ ์ƒˆ๋กœ์šด branch๋ฅผ ๋งŒ๋“ค๋˜, ์ด๋ฆ„์€ ๋ฐ˜๋“œ์‹œ!! 'gh-pages' ๋กœ ํ•œ๋‹ค. ๊ทธ๋Ÿฌ๊ณ  push.

2. ๊นƒํ—™ > ํ•ด๋‹น repository ์— ๋“ค์–ด๊ฐ€์„œ ์˜ค๋ฅธ ์ชฝ์— 'Environments' ์•„๋ž˜ 'github pages' ํด๋ฆญ > 'View deployment'

>> ๊ทธ๋Ÿผ ์งœ์ž” ํ•˜๊ณ  ์‚ฌ์ดํŠธ๊ฐ€ ๋‚˜์˜จ๋‹ค.

๋‹จ, ์‚ฌ์ดํŠธ๋Š” ์ •์ ์ธ ์‚ฌ์ดํŠธ๋กœ, html, css, js๋กœ ํ”„๋ก ํŠธ์—”๋“œ๋งŒ ๋‹ค๋ฃฌ ์‚ฌ์ดํŠธ๋งŒ ๊ฐ€๋Šฅ. ๋ฐฑ์—”๋“œ๋Š” ์•ˆ๋จ!

** url ์ฃผ์†Œ: [username].github.io/[repositoryname]

 

how to update github pages: (์ด๋ฏธ publish ํ–ˆ๋Š”๋ฐ ์ˆ˜์ •ํ•˜๊ณ  ์‹ถ์€ ๊ฒฝ์šฐ)

1. master branch ๋ฅผ ์—ด์–ด๋†“๊ณ  vs code ์—์„œ ์ฝ”๋“œ ์ˆ˜์ • (make a commit) > push origin

2. gh-pages branch๋ฅผ ์—ด์–ด์ฃผ๊ณ  ์ƒ๋‹จ๋ฐ”์—์„œ Branch > Update from master ํด๋ฆญ > push origin