[til] 220319 - publishing website
๐ถ๐ซ๏ธ ์ค๋ ํ ์ผ ๐ถ๐ซ๏ธ
โ๏ธ ์ฝ์ฝ์ํก ํด๋ก ์ฝ๋ฉ - publishing website
BOJ - ์ ๋ ฌ
โ๏ธ ์ด์ฝํ ์ ๋ ฌ ๊ธฐ๋ณธ๋ฌธ์ ํ๊ธฐ
โ๏ธ ํต ์ ๋ ฌ ๋ณต์ต
Publishing Website
git branch: master branch ์์ ๋ค๋ฅธ feature์ ๋ํ๋ ์ปค๋ฐ๋ค. (์๋ก์ด ๊ธฐ๋ฅ์ ๋ค๋ฃจ๊ธฐ ์ํด ์๋ก์ด branch ์์ฑ)
์ด๋ก์์ด 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