[GitHub] GitHub Pages 사용하기

2023. 11. 23. 18:10 형상관리/GitHub

들어가기 전

  • GitHub Pages : github를 활용하여 정적(jpg, html과 같은) 파일을 서비스하는 방법

repository 생성

  • 루트 페이지로 생성시
    • repository 이름 : <username>.github.io
    • Root URL : http://<username>.github.io
  • 하위 프로젝트로 생성시
    • repository 이름 : <프로젝트명>
    • Root URL : http://<username>.github.io/<프로젝트명>

GitHub Pages 활성화

  • 프로젝트 > Settings
  • GitHub Pages > Source : 서비스할 브랜치를 지정하면 자동으로 활성화

서비스할 정적 파일 추가

  • 프로젝트 루트에 index.html 파일 추가
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>GitHub Pages</title>
</head>
<body>
    Hello World
</body>
</html>

페이지 접속 및 확인

  • 루트 페이지로 생성한 경우 : http://<username>.github.io/index.html
  • 하위 프로젝트로 생성한 경우 : http://<username>.github.io/<프로젝트명>/index.html

참고

출처 : https://sg-choi.tistory.com/242