<?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>Forem: Maksim Surguy</title>
    <description>The latest articles on Forem by Maksim Surguy (@msurguy).</description>
    <link>https://forem.com/msurguy</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%2F202176%2F08cacf13-23dd-47c9-a05a-319f2c2ff339.jpeg</url>
      <title>Forem: Maksim Surguy</title>
      <link>https://forem.com/msurguy</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/msurguy"/>
    <language>en</language>
    <item>
      <title>Automatically Deploying Nuxt.js + Express app on Now</title>
      <dc:creator>Maksim Surguy</dc:creator>
      <pubDate>Thu, 12 Sep 2019 18:16:20 +0000</pubDate>
      <link>https://forem.com/msurguy/automatically-deploying-nuxt-js-express-app-on-now-505g</link>
      <guid>https://forem.com/msurguy/automatically-deploying-nuxt-js-express-app-on-now-505g</guid>
      <description>&lt;p&gt;I published a demo project that can help you understand deployment environments on Now.sh and how to automatically push to those environments using Github Actions.&lt;/p&gt;

&lt;p&gt;Here's the link to the project: &lt;a href="https://github.com/msurguy/nuxt-express-now" rel="noopener noreferrer"&gt;https://github.com/msurguy/nuxt-express-now&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  More about the repository:
&lt;/h2&gt;

&lt;p&gt;The project has minimal structure to it, but it achieves the goals of demonstrating automatic deployments. It:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Uses latest stable version of Nuxt and Express (currently Nuxt 2.9.2)&lt;/li&gt;
&lt;li&gt;Uses API endpoint from the ENV file (or from Now.json files)&lt;/li&gt;
&lt;li&gt;Uses Github actions to deploy when a tag with a specific pattern is pushed&lt;/li&gt;
&lt;li&gt;Uses ES6 in Node server code&lt;/li&gt;
&lt;li&gt;Uses basic auth that is conditionally enabled / disabled via env variable&lt;/li&gt;
&lt;li&gt;Automatically trims old deployments (that are not aliased) once a week&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Assumptions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;The default branch is &lt;strong&gt;staging&lt;/strong&gt;. All PRs in the project are made against that branch&lt;/li&gt;
&lt;li&gt;When testing is done on staging and approved, PR is opened against master&lt;/li&gt;
&lt;li&gt;When this project is automatically deployed via Now + Github integration (not through Github Action), it uses now.json as the config.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's the diagram of what's happening when you push certain tags to the Github repository:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcc0hqg3rg4p36bl3g9bu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fthepracticaldev.s3.amazonaws.com%2Fi%2Fcc0hqg3rg4p36bl3g9bu.png" alt="Now and Nuxt and Express development"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope you enjoy and share this project!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>nuxt</category>
      <category>node</category>
    </item>
    <item>
      <title>Resources to make Github Actions useful</title>
      <dc:creator>Maksim Surguy</dc:creator>
      <pubDate>Wed, 21 Aug 2019 17:03:27 +0000</pubDate>
      <link>https://forem.com/msurguy/resources-to-make-github-actions-useful-27ld</link>
      <guid>https://forem.com/msurguy/resources-to-make-github-actions-useful-27ld</guid>
      <description>&lt;p&gt;As the new Github Actions feature is rolling out worldwide, I wanted to take a minute and compile a short list of resources that will help you get started with Actions and take full advantage of extreme power that they bring.&lt;/p&gt;

&lt;p&gt;Here are the resources that I recommend you check out when starting with Actions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check The Action Bible, aka "Workflow Syntax" to look through the syntax of Actions: &lt;a href="https://help.github.com/en/articles/workflow-syntax-for-github-actions"&gt;https://help.github.com/en/articles/workflow-syntax-for-github-actions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Browse through the list of "Awesome Actions" to find some inspiration: &lt;a href="https://github.com/sdras/awesome-actions"&gt;https://github.com/sdras/awesome-actions&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;When you want to use existing actions or find examples of Actions, check the Actions Marketplace:
&lt;a href="https://github.com/marketplace?utf8=%E2%9C%93&amp;amp;type=actions&amp;amp;query="&gt;https://github.com/marketplace?utf8=%E2%9C%93&amp;amp;type=actions&amp;amp;query=&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;If you're migrating actions from old syntax to new syntax: &lt;a href="https://help.github.com/en/articles/migrating-github-actions-from-hcl-syntax-to-yaml-syntax"&gt;https://help.github.com/en/articles/migrating-github-actions-from-hcl-syntax-to-yaml-syntax&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;To understand the events that trigger workflows: &lt;a href="https://help.github.com/en/articles/events-that-trigger-workflows"&gt;https://help.github.com/en/articles/events-that-trigger-workflows&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Hope you find these resources useful, have fun, and stay active!&lt;/p&gt;

</description>
      <category>github</category>
      <category>actions</category>
      <category>automation</category>
      <category>devops</category>
    </item>
    <item>
      <title>Clean local GIT branches</title>
      <dc:creator>Maksim Surguy</dc:creator>
      <pubDate>Fri, 16 Aug 2019 16:57:35 +0000</pubDate>
      <link>https://forem.com/msurguy/clean-local-git-branches-4fc7</link>
      <guid>https://forem.com/msurguy/clean-local-git-branches-4fc7</guid>
      <description>&lt;p&gt;To clean all of your local branches except the current &lt;code&gt;HEAD&lt;/code&gt;, &lt;code&gt;master&lt;/code&gt; and &lt;code&gt;staging&lt;/code&gt;, you can use this script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;git branch | &lt;span class="nb"&gt;grep&lt;/span&gt; &lt;span class="nt"&gt;-v&lt;/span&gt; &lt;span class="s2"&gt;"master&lt;/span&gt;&lt;span class="se"&gt;\|&lt;/span&gt;&lt;span class="s2"&gt;staging"&lt;/span&gt; | xargs git branch &lt;span class="nt"&gt;-D&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;You can add more branches to the list of the ones that you want to skip, for example if you wanted to keep &lt;code&gt;dev&lt;/code&gt; branch in addition to the current branch, master and staging:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"master\|staging\|dev"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;To further automate this, you can add an alias to your terminal by modifying your &lt;code&gt;~/.bash_profile&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;...
&lt;span class="nb"&gt;alias &lt;/span&gt;clean-branches&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"git branch | grep -v &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;master&lt;/span&gt;&lt;span class="se"&gt;\|&lt;/span&gt;&lt;span class="s2"&gt;staging&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; | xargs git branch -D"&lt;/span&gt;
...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now, when you're within the project directory, you can use &lt;code&gt;clean-branches&lt;/code&gt; command to perform this trimming automatically.&lt;/p&gt;

&lt;p&gt;Enjoy!&lt;/p&gt;

</description>
      <category>git</category>
      <category>sprint</category>
      <category>automation</category>
    </item>
  </channel>
</rss>
