Movatterモバイル変換


[0]ホーム

URL:


Skip to content
DEV Community
Log in Create account

DEV Community

Cover image for Deploy Your First Website without Leaving Your IDE
GitHub profile imageRizèl Scarlett
Rizèl Scarlett forGitHub

Posted on • Edited on

     

Deploy Your First Website without Leaving Your IDE

Why I built It

I built a VS Code Extension that deploys code to GitHub Pages.

I’ve always wanted to build a VS code extension, but I never had a reason or enough time. Now that I work in DevRel at GitHub, I finally got the opportunity to do so! The Microsoft VS Code team runs aresume website workshop where participants deploy a resume built with HTML and CSS to GitHub Pages.

I collaborated with the VS Code team to create a VS Code Extension that enables you to quickly deploy your static web page (Jekyll or HTML) to GitHub Pages without leaving your IDE.

My two favorite things are making a positive impact and experimenting with technologies I haven’t used!

How it works

There’s still room for improvement with the user experience and the workflow. Still, for my initial iteration to deploy your code to GitHub Pages using the extension I built, you can take the following steps:

Image description

  • Create an index.html file at the very least. You can add CSS and JavaScript, too. For this blog post, I will create an HTML file. I created a file called index.html with an h1 element that includes a quote from the movie Spiderman: Intro to Spiderverse and an image from the movie as well.

Image description

  • Don’t forget to commit your file. The screenshot below indicates that I clicked the “Commit new file” button to commit my newly created index.html file.

Image description

  • Install the VS Code extension called “Deploy to GitHub Pages.” To find the extension, I clicked the extensions icon in Visual Studio Code and searched for “Deploy to GitHub Pages.” I pressed install for that particular extension.

Image description

  • Open the search bar to search for new files. You can do this through the following methods:
    • Using Go to File, which is under the Go menu
    • Using this keyboard shortcut on Windows Ctrl+p or Ctrl+e
    • Using this keyboard shortcut on macOS Cmd ⌘+p
    • Using this keyboard shortcut on Linux Ctrl+p or Ctrl+e

Image description

  • Trigger the extension by typing “>” in the search bar. If it works correctly, you should see the words “Deploy to GitHub Pages” as shown in the image below.

Image description

  • Once you choose the “Deploy to GitHub Pages”, you will receive a prompt to sign into GitHub.

Image description

  • After you complete the authentication process, your IDE will reveal a dropdown with your ten most recently created repositories. In the screenshot, my “ghpages-into-the-spiderverse” repository is at the top of the list.

Image description

  • After choosing the repository, “ghpages-into-the-spiderverse”, a toast message appears, prompting me to publish the repository to GitHub Pages. Click the “Publish” button to confirm that you want to deploy the repository to GitHub Pages.

Image description

  • The toast will update with a message that your site will go live in a few minutes.

Image description

  • Check the Actions logs for progress. GitHub Pages uses an action to build and deploy the site. If you see all green checkmarks, like the image below, your site is live!

Image description

Image description

How I Built It

I wrote about the anatomy of my VS Code extensionhere.

Open to Contributions

Honestly, I didn’t invest as much time as I wanted into creating this extension. There’s room for improvement. I’m open to contributions in helping me improve my README, improving the workflow, and more. Feel free to open up an issue and a pull request in this repository:https://github.com/blackgirlbytes/vscodeextension-deploy-to-gh-pages

Tell me about your favorite VS Code extension in the comments below!

Top comments(12)

Subscribe
pic
Create template

Templates let you quickly answer FAQs or store snippets for re-use.

Dismiss
CollapseExpand
 
blake_seipler_9a529405ec1 profile image
Blake Seipler
  • Joined

This looks great! Thanks!

CollapseExpand
 
nancybennetts profile image
Nancy Bennetts
Life is what happens when you're busy making other plans...
  • Location
    NJ, United States
  • Education
    Indiana University
  • Work
    It's All Leggings
  • Joined

Woow. Thanks!

CollapseExpand
 
tykok profile image
Tykok
👨🎓About Me :Creative, with a real critical mind and a real desire to continuously improve myself.Passionate about this field, I love to share and discuss about it and learn more.
  • Location
    Toulouse
  • Education
    Reunion Island and France
  • Work
    Backend Developper
  • Joined

Very usefull, i'm gonna use it for a project ;)

CollapseExpand
 
khokon profile image
Khokon M.
  • Joined

Great work 👏

CollapseExpand
 
zepef profile image
Pierre-Emmanuel FEGA
I've been a computer dev for 30+ years and a tech writer and teacher for 20 years
  • Location
    Antananarivo / Madagascar
  • Work
    Data Scientist / Machine Learning Engineeer at Self employed
  • Joined

Excellent, I love it. Bravo !

CollapseExpand
 
khulyso profile image
khulyso John
Agile Software developer | Techbridle Fundation Student | Javascript | C# & .NET | Workshop Facilitators (Volunteers)
  • Email
  • Location
    Fripp,Limpopo Province,South Africa
  • Education
    Responsive website design at Freecodecamp
  • Work
    still studying
  • Joined

Very usefull,thank you.

CollapseExpand
 
cetinogut profile image
Cetin OGUT
  • Joined

Very good and informative. Thanks.

CollapseExpand
 
drfcozapata profile image
Francisco Zapata
Vue.js/Laravel Fullstack Web Developer... one line of code at a time
  • Email
  • Location
    Puerto Ordaz, Venezuela
  • Education
    Academlo
  • Pronouns
    He / Him
  • Work
    Vue.js/Laravel Developer
  • Joined

VScode let you create a new repository without open GitHub in a Web client, directly from itself. That complement this information and make it really cool.
Thanks a lot! Blessings from Venezuela.

CollapseExpand
 
blackgirlbytes profile image
Rizèl Scarlett
Staff Developer Advocate at Block; previously at GitHub.I'm interested in Generative AI, AI Dev Tools, Data Privacy, and Responsible AI
  • Education
    Boston University
  • Work
    Developer Advocate at Block
  • Joined

I forgot you can do that in VS Code! Love that it works well for your use case.

CollapseExpand
 
johannesmogashoa profile image
Johannes Mogashoa
Full Stack Javascript and C# developer. Lover of all things problem solving and worthwhile.
  • Email
  • Location
    Johannesburg, South Africa
  • Education
    Nelson Mandela University
  • Work
    Software Developer at Imperial Insync Solutions
  • Joined

This is super cool man I won't lie. Just a question, why extension over like a command line tool?

CollapseExpand
 
blackgirlbytes profile image
Rizèl Scarlett
Staff Developer Advocate at Block; previously at GitHub.I'm interested in Generative AI, AI Dev Tools, Data Privacy, and Responsible AI
  • Education
    Boston University
  • Work
    Developer Advocate at Block
  • Joined

Thanks! It’s for a resume building workshop for people learning to code. Usually, the command line is another hurdle for folks that are just learning HTML and CSS.

CollapseExpand
 
pwong09 profile image
pwong09
A Full-Stack Software Developer with a background in economics and community organizing. Passionate about accessible products and improving user experiences and engagement.
  • Location
    Vancouver, BC
  • Joined

so useful!!

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment'spermalink.

For further actions, you may consider blocking this person and/orreporting abuse

Let's build from here_

Celebrate 20 years of Git atGit Merge 2025. Join developers from around the world this September in San Francisco.

More fromGitHub

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

Log in Create account

[8]ページ先頭

©2009-2025 Movatter.jp