Gatsby Static websites CI/CD using Gitlab

Gatsby Static websites CI/CD using Gitlab

In my previous article "Is serverless system design the future?" (https://www.dhirubhai.net/pulse/serverless-system-design-future-rany-elhousieny/ ) I promised to explain how to deploy my static website (https://rany.tk/) that was created with Gatsby to S3, and I forgot :(. Here I am after few months showing how to auto deploy the site to S3 using Gitlab, which I use for CI/CD. (Code at https://github.com/ranyelhousieny/myResume_GatsBy_Gitlab)

  1. Create Gitlab project

Add to Gitlab

https://gitlab.com/

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

2. Now from the directory where I have the code for the website I run the following commands:

git init

git remote add origin [email protected]:elhousie/resume-for-rany-elhousieny.git

git add .

git commit -m "Initial commit"

git push -u origin master

3. Now create the pipeline .gitlab-ci.yml as follows

No alt text provided for this image


when you push your changes, the pipeline will build automatically

No alt text provided for this image

Finally, let's deploy to S3

No alt text provided for this image

File can be found at https://github.com/ranyelhousieny/myResume_GatsBy_Gitlab/blob/master/.gitlab-ci.yml

No alt text provided for this image


 


 


 

要查看或添加评论,请登录

社区洞察

其他会员也浏览了