DAY 13-DEPLOYING

Hello all.....today I am going to share with you about how to deploy your static website into a live one via GitLab...the steps are as follows: 1.Create an account in GitLab and login to your account. 2.Go to Projects tab and click on New Project -> Create a blank Project. You will be asked to select a name for your project. Choose any name you want. 3.Under Project URL tab you need to select a namespace.You can create a new one or else choose from the ones listed by Gitlab. Next you need to set the visibility level to public and under project configuration select initialize repository with a README.Click on create project. 4.You will be directed to your project's repository(folder) with a readme file initialized in it. Next on the top left corner of your repository select the + symbol with a dropdown beside it. Click on upload file and upload the necessary html and ** css** files required for the site to load. If you have any image files seperately which is used by your site then upload that also. Do note that you definitely need to have a file named index.html incase of multiple HTML files and in case it is a single HTML file then it should be named as index.html. This will be considered as your root file and without this the site will not be deployed. 5.Once all the files are uploaded click + symbol again and select new file. Name the file as gitlab-ci.yml and paste in the following code: pages: stage: deploy script: - mkdir public - cp index.html public/ artifacts: paths: - public only: - main It will suggest creating a template file but copy the above code only. Also if your images and css are in a separate file or folder you need to make them also public by adding the following code: script: - mkdir public - cp index.html public/ - cp-r Folder(or)Filename/public Once this file is created,GitLab will automatically start the deployment process. 6.Go to menu icon on the top left corner of your project and click on Deploy->Pages to check the status of your live site. 7.After few minutes your site will become live and the URL will be displayed in the Pages tab. That's all for today...hope this helps for those who need to create a live site.

Jun 25, 2025 - 17:50
 0
DAY 13-DEPLOYING

Hello all.....today I am going to share with you about how to deploy your static website into a live one via GitLab...the steps are as follows:

1.Create an account in GitLab and login to your account.

2.Go to Projects tab and click on New Project -> Create a blank Project. You will be asked to select a name for your project. Choose any name you want.

3.Under Project URL tab you need to select a namespace.You can create a new one or else choose from the ones listed by Gitlab. Next you need to set the visibility level to public and under project configuration select initialize repository with a README.Click on create project.

4.You will be directed to your project's repository(folder) with a readme file initialized in it. Next on the top left corner of your repository select the + symbol with a dropdown beside it. Click on upload file and upload the necessary html and ** css** files required for the site to load. If you have any image files seperately which is used by your site then upload that also. Do note that you definitely need to have a file named index.html incase of multiple HTML files and in case it is a single HTML file then it should be named as index.html. This will be considered as your root file and without this the site will not be deployed.

5.Once all the files are uploaded click + symbol again and select new file. Name the file as gitlab-ci.yml and paste in the following code:

pages:
  stage: deploy
  script:
    - mkdir public
    - cp index.html public/
  artifacts:
    paths:
      - public
  only:
    - main

It will suggest creating a template file but copy the above code only. Also if your images and css are in a separate file or folder you need to make them also public by adding the following code:

script:
- mkdir public
    - cp index.html public/
    - cp-r Folder(or)Filename/public

Once this file is created,GitLab will automatically start the deployment process.

6.Go to menu icon on the top left corner of your project and click on Deploy->Pages to check the status of your live site.

7.After few minutes your site will become live and the URL will be displayed in the Pages tab.

That's all for today...hope this helps for those who need to create a live site.