loading...
Cover image for Semantic Release Automation - Part 3 - deploy to github pages

Semantic Release Automation - Part 3 - deploy to github pages

abdelrahmanahmed profile image Wahdan ・2 min read

Semantic Release Automation (3 Part Series)

1) Semantic Release Automation - Part 1 - Understanding Semantic Version 2) Semantic Release Automation - Part 2 - Setup Semantic Release Package 3) Semantic Release Automation - Part 3 - deploy to github pages

In part 2 of Semantic Release Automation series, we configured our Continues Integration part in our workflow using semantic release package along with Github Actions and GitHub Packages. Now lets go live and configure the deployment workflow using Github pages.

Table of contents

  1. Prerequisites
  2. Configure repository settings
  3. Update Github Action

Prerequisites

  • Basic knowledge of CI/CD workflow, you can refer to my 2 mins article about this topic.
  • Create Github token, this will be used by Github pages action ( you can skip this part if you have already created it in the previous series).

Configure repository settings

  • In your Github repository, Create a new branch from your main branch with name gh-pages.
  • Navigate to settings option.
  • Go to GitHub Page section.
  • Make sure that your are selecting the source branch to gh-pages which you created before.

gh pages

  • Now copy your site URL and open your package.json file add homepage key with your site URL as a value.

Update Github Action

To simply things for us we are going to use a ready action to deploy to github pages. You can find a full example in the following gist below:

Now push a new commit and watch your pipeline in action, in a successful scenario you should find the build results in gh-pages and your code is deployed to your site URL.

DEMO

Thanks for reading, waiting your feedback.

Cover Design Credit: Infographic vector created by studiogstock - www.freepik.com

Semantic Release Automation (3 Part Series)

1) Semantic Release Automation - Part 1 - Understanding Semantic Version 2) Semantic Release Automation - Part 2 - Setup Semantic Release Package 3) Semantic Release Automation - Part 3 - deploy to github pages

Posted on May 25 by:

abdelrahmanahmed profile

Wahdan

@abdelrahmanahmed

Full stack software engineer with a flair for creating elegant solutions with the least amount of time.Exceptional problem solver with an aptitude for troubleshooting and the ability to quickly master

Discussion

markdown guide