<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Aaron Perez</title>
    <description>The latest articles on DEV Community by Aaron Perez (@rarean).</description>
    <link>https://dev.to/rarean</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F393944%2Fbdb90df2-d1fd-4f8d-b52c-8678312edb03.png</url>
      <title>DEV Community: Aaron Perez</title>
      <link>https://dev.to/rarean</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/rarean"/>
    <language>en</language>
    <item>
      <title>Bootstrap Portfolio w/GitHub Actions</title>
      <dc:creator>Aaron Perez</dc:creator>
      <pubDate>Mon, 25 May 2020 00:53:34 +0000</pubDate>
      <link>https://dev.to/rarean/bootstrap-portfolio-w-github-actions-1gbf</link>
      <guid>https://dev.to/rarean/bootstrap-portfolio-w-github-actions-1gbf</guid>
      <description>&lt;h1&gt;
  
  
  Deploy your Bootstrap portfolio to GitHub Pages effortlessly
&lt;/h1&gt;

&lt;p&gt;There are a few different ways of getting started with a website using bootstrap. You could start from scratch, you might have a website that you have put together based on a template, or you can fork an existing site and remake it as your own. However you obtain your site code, you want to publish the site somewhere and have heard about GitHub Pages, but you don’t know how to use GitHub to turn it into a free website.&lt;/p&gt;

&lt;p&gt;This tutorial is less focused on the portfolio site code and more on how easy it is to use &lt;a href="https://github.com/features/actions"&gt;GitHub Actions&lt;/a&gt; to deploy your code to &lt;a href="https://guides.github.com/features/pages/"&gt;GitHub Pages&lt;/a&gt;. For simplicity, I will use an example one page portfolio created with bootstrap and publish to GitHub Pages. If you already have a website ready to go, you can skip to the deployment section.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;

&lt;p&gt;I will assume you already have the necessary tools installed, and a GitHub account. If you do not have a GitHub account or need to install tools (npm, nodes, and git) please do so before continuing.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fork the example repository &lt;a href="https://github.com/rarean/portfolio-demo"&gt;https://github.com/rarean/portfolio-demo&lt;/a&gt;. It will take a few seconds to make a full copy of the example “portfolio-demo”.
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MPe-wJGc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://rarean.github.io/portfolio-demo/img/RepoFork.png" width="400px"&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Go to the Settings tab and rename the repository to &lt;code&gt;USERNAME.github.io&lt;/code&gt;, be sure to use &lt;strong&gt;your username&lt;/strong&gt; in place of &lt;strong&gt;USERNAME&lt;/strong&gt;. This username should also match your account name in GitHub.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For example, you can see that mine is &lt;code&gt;rarean.github.io&lt;/code&gt; and my GitHub username is also &lt;a href="https://github.com/rarean"&gt;rarean&lt;/a&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ux75QuAA--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://rarean.github.io/portfolio-demo/img/RepoName.png" width="400px"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Clone the repo to your computer so that you have a local copy of the code to update with your changes&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s---OukdPR0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://rarean.github.io/portfolio-demo/img/RepoClone.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s---OukdPR0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://rarean.github.io/portfolio-demo/img/RepoClone.png" width="400px"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open the &lt;a href="https://github.com/rarean/portfolio-demo/blob/master/index.html"&gt;index.html&lt;/a&gt; file and edit the appropriate sections.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"name"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"d-block text-lg"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; Your Name &lt;span class="nt"&gt;&amp;lt;/span&lt;/span&gt; &lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;span&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"links"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"text-md"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://github.com/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;i&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"fa fa-github mx-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://www.linkedin.com/"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;i&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"fa fa-linkedin-square mx-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mailto:your.mail@me.com?Subject=Hello%20again"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;i&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"fa fa-envelope-square mx-2"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/i&amp;gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;





&lt;div class="highlight"&gt;&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"contact"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"col d-sm-block mx-auto my-auto text-center"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"https://github.com/"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"badge badge-light mt-5"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Projects&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"mailto:your.mail@me.com?Subject=Hello%20again"&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"badge badge-light"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;your.mail@me.com&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;5.Verify all your changes are correct and show up as expected before continuing&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the root folder of your project, run &lt;code&gt;npm install&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Once &lt;code&gt;node_modules&lt;/code&gt; are installed, run &lt;code&gt;npm start&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Deploying Your Portfolio
&lt;/h2&gt;

&lt;p&gt;The magic that creates the site on GitHub Pages is found in the &lt;code&gt;.github/workflows/deploy.yml&lt;/code&gt; file. If you have an existing site or code that you want to publish to GitHub pages, you only need to add this file (and it's parent folders) to your project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Build and Deploy&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;push&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;master&lt;/span&gt;
&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;build-and-deploy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Checkout&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v2&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;persist-credentials&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;false&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Install and Build&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;|&lt;/span&gt;
          &lt;span class="s"&gt;npm install&lt;/span&gt;
          &lt;span class="s"&gt;npm run build&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Deploy&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;JamesIves/github-pages-deploy-action@releases/v3&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;GITHUB_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GITHUB_TOKEN }}&lt;/span&gt;
          &lt;span class="na"&gt;BRANCH&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;gh-pages&lt;/span&gt;
          &lt;span class="na"&gt;FOLDER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;dist&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This file tells GitHub Actions to install the project dependencies, run a build script that puts the required files in an output folder named “dist”, and then upload the contents of the “dist” folder to the gh-pages branch. If the branch does not exist, it will create the branch. &lt;br&gt;
The work to deploy the site to GitHub Pages is thanks to &lt;a href="https://github.com/JamesIves/github-pages-deploy-action"&gt;JamesIves/github-pages-deploy-action&lt;/a&gt;, and you can check GitHub for the different &lt;a href="https://github.com/JamesIves/github-pages-deploy-action#configuration-"&gt;configuration options&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Once you have a portfolio site ready for GitHub Pages, and your project includes the &lt;code&gt;.github/workflows/deploy.yml&lt;/code&gt; file, you only need to commit and push your changes to the master branch of your repository. After the GitHub Actions have run, and the gh-pages branch exists, ensure settings are pointing to the correct branch to display your site.&lt;/p&gt;

&lt;p&gt;Go to the settings of your repository and ensure that the source for GitHub Pages is using the correct branch. It is close to the bottom of the main settings page.&lt;br&gt;
    &lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--NxqXvOhT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://rarean.github.io/portfolio-demo/img/RepoGH-Pages.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--NxqXvOhT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://rarean.github.io/portfolio-demo/img/RepoGH-Pages.png" width="600px"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note that it may take a few minutes to populate DNS servers for it to show up in your browser; however, once available, you can click the link in green bar that GitHub says your site is available at.&lt;/p&gt;

&lt;p&gt;Thats It!&lt;br&gt;
Easy Right!&lt;/p&gt;

</description>
      <category>bootstrap</category>
      <category>githubactions</category>
      <category>githubpages</category>
    </item>
  </channel>
</rss>
