Kundra
Be a part of Nullsto's Growth ;)
Staff member
Moderator
Nullsto Lover
GiveAway Master
Trusted Uploader
- Joined
- Sep 16, 2022
- Messages
- 4,219
- Reaction score
- 6,568
- Points
- 193
Free Hosting Website On Gitlab - GitLab Pages is a product of the GitLab git repository where we can host HTML static websites or CMS static website generators such as Jekyll, Middleman, Hexo, Hugo, and Pelican.
By default the URL used to access websites hosted on GitLab is . This URL can be replaced with our own domain/subdomain and supports HTTPS by using an SSL/TLS certificate from Let's Encrypt.
Here's a tutorial on how to host a free HTML website on GitLab pages
The next step is to push the HTML website to the GitLab repository. For how to connect ssh, I have reviewed Akuh.net in the previous article, then
Configure GitLab account in local repository
git init
git config user.name "GitLab Account Name"
git config user.email "[email protected]"
git remote add origin [email protected]:username/projectname.git
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
git add .
git commit -m "Initial commit"
git push -u origin master
After the pipeline's status changes to pass, it means the HTML website has been successfully deployed to GitLab Pages. But the website doesn't appear right away, if we access the GitLab Pages project URL, the error message that appears is 404. The experiment I did took 10 to 30 minutes
The access URL is , you can check it in Project Name -> Settings -> Pages.
In addition to using domains, we can also use subdomains.
Thus the article this time for Free Website Hosting On Gitlab for more details,
By default the URL used to access websites hosted on GitLab is . This URL can be replaced with our own domain/subdomain and supports HTTPS by using an SSL/TLS certificate from Let's Encrypt.
Here's a tutorial on how to host a free HTML website on GitLab pages
Creating a GitLab Repository
The first step is to create a new repository or project on GitLab. Repositories created for GitLab can be set to private, they don't have to be set to public.- Push HTML to Repository
The next step is to push the HTML website to the GitLab repository. For how to connect ssh, I have reviewed Akuh.net in the previous article, then
Configure GitLab account in local repository
git init
git config user.name "GitLab Account Name"
git config user.email "[email protected]"
git remote add origin [email protected]:username/projectname.git
- Create a .gitlab-ci.yml file in the HTML website directory.
stage: deploy
script:
- mkdir .public
- cp -r * .public
- mv .public public
artifacts:
paths:
- public
only:
- master
- Then push it to the GitLab repository
git add .
git commit -m "Initial commit"
git push -u origin master
- Monitor deploy status in Project Name -> CI/CD -> Pipelines. The final result must be passed.
After the pipeline's status changes to pass, it means the HTML website has been successfully deployed to GitLab Pages. But the website doesn't appear right away, if we access the GitLab Pages project URL, the error message that appears is 404. The experiment I did took 10 to 30 minutes
The access URL is , you can check it in Project Name -> Settings -> Pages.
How to Change URL with Domain + SSL
- Go to the Project Name -> Settings -> Pages page, click New Domain.
- Enter domain name and enable SSL Let's Encrypt, then Create New Domain.
- Then create a DNS record, CNAME record to hostname username.gitlab.io or it could be A record to IP 35.185.44.232, and TXT record for domain verification.
- After the DNS record is added, click the button for verification. If successful, the status becomes Verified.
- The installation of this domain is also not active immediately, it takes a few minutes.
In addition to using domains, we can also use subdomains.
Thus the article this time for Free Website Hosting On Gitlab for more details,
Last edited: