<?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: Francisco Javier Arceo</title>
    <description>The latest articles on DEV Community by Francisco Javier Arceo (@franciscojarceo).</description>
    <link>https://dev.to/franciscojarceo</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%2F439922%2Fa02546a6-755c-41b3-8b26-20c8337145cc.jpg</url>
      <title>DEV Community: Francisco Javier Arceo</title>
      <link>https://dev.to/franciscojarceo</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/franciscojarceo"/>
    <language>en</language>
    <item>
      <title>Deploying a Next.js site using Github Actions</title>
      <dc:creator>Francisco Javier Arceo</dc:creator>
      <pubDate>Wed, 06 Jan 2021 01:39:21 +0000</pubDate>
      <link>https://dev.to/franciscojarceo/deploying-a-next-js-site-using-github-actions-1g1e</link>
      <guid>https://dev.to/franciscojarceo/deploying-a-next-js-site-using-github-actions-1g1e</guid>
      <description>&lt;p&gt;&lt;em&gt;Note: This is post assumes familiarity with React, JavaScript, basics of web development, and GitHub actions.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I'm a huge fan of &lt;a href="https://github.com/features/actions"&gt;GitHub Actions&lt;/a&gt;. They're so simple but so effective at doing such a broad range of things. In short, you can tell GitHub do something on a computer everytime you push a commit to your repository (or to a branch on a specific repository like the &lt;code&gt;main&lt;/code&gt; branch).&lt;/p&gt;

&lt;p&gt;For today's post, I'll focus on how I used an action to automate deploying my static site built with Next.js to &lt;a href="https://pages.github.com"&gt;GitHub Pages&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I made this blog on a repository hosted on GitHub and added a GirHub Action to compile the JavaScript/React code into static HTML files. This really didn't require all that much effort.&lt;/p&gt;

&lt;p&gt;Here's what I had to do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Build a Next.js blog following the &lt;a href="https://nextjs.org/learn/basics/create-nextjs-app"&gt;detailed tutorial&lt;/a&gt; and store the code on a GitHub repository&lt;/li&gt;
&lt;li&gt;Create a workflow file in the repository with the following path: &lt;a href="https://github.com/franciscojavierarceo/franciscojavierarceo.github.io/blob/main/.github/workflows/integrate.yml"&gt;&lt;code&gt;./github/workflows/integrate.yml&lt;/code&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Specify that workflow file to export the static files whenever I push to &lt;code&gt;main&lt;/code&gt; and &lt;em&gt;commit&lt;/em&gt; the exported files to a separate branch called &lt;code&gt;gh-pages&lt;/code&gt; (you can just follow the workflow file I used)&lt;/li&gt;
&lt;li&gt;Manually add a &lt;code&gt;.nojekyll&lt;/code&gt; file to the &lt;code&gt;gh-pages&lt;/code&gt; branch (this is to resolve &lt;a href="https://github.com/vercel/next.js/issues/2029"&gt;this bug&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Configure my repository Settings so that it sources the GitHub Pages build from the &lt;code&gt;gh-pages&lt;/code&gt; branch&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;And that's it, adding new blog posts is as simple as creating a new &lt;a href="https://www.markdownguide.org/"&gt;markdown&lt;/a&gt; file and pushing it to the main branch. The GitHub Action will handle all of the rest!&lt;/p&gt;

&lt;p&gt;This is much nicer in behavior than my old site, which was built using Jekyll (a Ruby framework) and it's much less work than building a full application with Django to get high quality page loads. I’d add that I’m a huge fan of Django but I think for a static, fast, and lightweight site, Next.js my new go to! &lt;/p&gt;

&lt;p&gt;--&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I also occasionally blog on my &lt;a href="https://franciscojavierarceo.github.io/"&gt;personal site&lt;/a&gt;, where this post was originally published.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>github</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
