<?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: Brandon Ward</title>
    <description>The latest articles on DEV Community by Brandon Ward (@bwvolleyball).</description>
    <link>https://dev.to/bwvolleyball</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%2F198046%2Fa20df9fd-a348-4d42-91d6-5859c27d38ad.jpeg</url>
      <title>DEV Community: Brandon Ward</title>
      <link>https://dev.to/bwvolleyball</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bwvolleyball"/>
    <language>en</language>
    <item>
      <title>A Blogging Platform Where Everyone Gets Paid</title>
      <dc:creator>Brandon Ward</dc:creator>
      <pubDate>Sun, 28 Mar 2021 20:30:39 +0000</pubDate>
      <link>https://dev.to/bwvolleyball/a-blogging-platform-where-everyone-gets-paid-3a7e</link>
      <guid>https://dev.to/bwvolleyball/a-blogging-platform-where-everyone-gets-paid-3a7e</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--hh2ms0AQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xxfffctlsnqesu4z2k4.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--hh2ms0AQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5xxfffctlsnqesu4z2k4.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In the world of content creation, it is important to be a member of several content creation sites. Dev To is an excellent platform for all things tech.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enter an Alternative Platform
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;No, you do not need to remove DevTo from your content creation strategy.  In fact, you should actually pick your blogging platform based on your target audience!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Did you know there is a blogging platform out there named &lt;a href="https://www.publish0x.com/?a=GRb4852nbB&amp;amp;tid=devto"&gt;Publish0x&lt;/a&gt;, with the mission of paying both content creators and readers for their time? They pay in cryptocurrency, but the money is real!  &lt;/p&gt;

&lt;h4&gt;
  
  
  How do I get paid?
&lt;/h4&gt;

&lt;p&gt;They have 2 ways you can upvote a blog - tipping, or liking. Likes are similar to the kudos you can give on this platform, but tipping pays everyone involved!  You have a limited number of tips each day, and these are rate-limited throughout the day as well. Tips are free, and come from Publish0x's rewards pool.  The concept is unique and amazing - the standard tip is 80% of the tip to the content creator, and 20% to the content reader, but you can adjust the tip based on how valuable you feel the content is.  This is a platform that pays everyone for their time!&lt;/p&gt;

&lt;h4&gt;
  
  
  What types of things will I find on Publish0x?
&lt;/h4&gt;

&lt;p&gt;Anything, really. But this blogging platform is cryptocurrency heavy, and so it's an excellent platform to follow for Crypto news and trends.  &lt;a href="https://www.publish0x.com/?a=GRb4852nbB&amp;amp;tid=devto"&gt;If you haven't seen this platform, you're not risking anything by giving it a shot&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>blockchain</category>
      <category>cryptocurrency</category>
      <category>blogging</category>
      <category>publish0x</category>
    </item>
    <item>
      <title>GPG Signing Github Commits</title>
      <dc:creator>Brandon Ward</dc:creator>
      <pubDate>Tue, 07 Jan 2020 04:33:18 +0000</pubDate>
      <link>https://dev.to/bwvolleyball/gpg-signing-github-commits-1265</link>
      <guid>https://dev.to/bwvolleyball/gpg-signing-github-commits-1265</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;GPG, or the GNU Privacy Guard, is a complete and free implementation of the OpenPGP standard, and allows you to encrypt or sign your communications.&lt;sup&gt;1&lt;/sup&gt; While gpg is a great tool for encryption, this blog post will focus on the signing aspect, specifically, when using it to sign git commits for a GitHub repository.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Why?
&lt;/h3&gt;

&lt;p&gt;Why should I GPG sign my commits? Simple, so that you can prove that they came from you! Just as in the world of academia, your reputation is everything, you should do everything in your power to protect it! While I am not saying anyone would ever try to steal your software engineering identity, GPG signing your commits is an easy way to guarantee that you can prove which commits you have or have not made.&lt;/p&gt;

&lt;p&gt;I have configured my laptop to auto-sign all commits with my GPG key.  Doing this allows all commits I create to have the 'Verified' stamp when viewing them in GitHub.&lt;/p&gt;

&lt;p&gt;Whenever you view a commit I have created, it will appear like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XAsAapya--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/z9jsfmvc2amt86rx30oq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XAsAapya--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/z9jsfmvc2amt86rx30oq.png" alt="Example of a GitHub Verified commit"&gt;&lt;/a&gt;&lt;/p&gt;
Example of a GitHub Verified commit.



&lt;p&gt;Clicked on the &lt;code&gt;Verified&lt;/code&gt; gives additional information to prove that I am the one who as signed this commit, because I have uploaded my GPG key to my GitHub profile:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lr8T52Go--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jexgqoxtdgphoeb89sdl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lr8T52Go--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/jexgqoxtdgphoeb89sdl.png" alt="GPG Signature Details"&gt;&lt;/a&gt;&lt;/p&gt;
GPG Signature Details.



&lt;p&gt;Just because a commit is signed with a GPG key though, does not make it verified.  When I was initially setting this all up, the GPG key I used was secured with a password that my toolchain could not support.  As a result, I decided to delete that GPG key and start fresh.  Here is what my test commit with that key looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--1PuiE5j---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/2h3ybt18bmrqo7smgaq4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--1PuiE5j---/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/2h3ybt18bmrqo7smgaq4.png" alt="Unverified GPG Key"&gt;&lt;/a&gt;&lt;/p&gt;
Unverified GPG Key.



&lt;p&gt;As you can see, I am in full control of this signing mechanism, and it is an excellent way to self-verify your work.&lt;/p&gt;

&lt;h3&gt;
  
  
  How?
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;This guide is written for MacOS.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The how-to articles are plentiful on the internet, and so here's another.  Beyond just providing the steps though, this guide hopes to explain what each command is for (if it's not clear already).&lt;/p&gt;

&lt;h4&gt;
  
  
  Installations
&lt;/h4&gt;

&lt;p&gt;First, we need to install some tools.  This guide assumes you have &lt;a href="https://brew.sh/"&gt;Homebrew&lt;/a&gt; already installed.  Homebrew is a MacOS package manager, and is incredibly useful for toolchain installation management.&lt;/p&gt;

&lt;p&gt;Using Homebrew, install the gnupg command line tool for working with gpg keys, and pinentry for Mac. Pinentry is a collection of GUI based programs for working with GPG keys&lt;sup&gt;2&lt;/sup&gt;, and pinentry for Mac will allow us to save the GPG key password to our keychain for easier access.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;brew &lt;span class="nb"&gt;install &lt;/span&gt;gnupg pinentry-mac
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Configure Pinentry
&lt;/h4&gt;

&lt;p&gt;We then must do some work to ensure pinentry is used immediately for interacting with our GPG keys.&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;echo&lt;/span&gt; &lt;span class="s2"&gt;"pinentry-program /usr/local/bin/pinentry-mac"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ~/.gnupg/gpg-agent.conf
killall gpg-agent
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We tell our gpg agent to default to pinentry with the first command, and secondly, we kill all running gpg-agents to make sure our configuration takes effect immediately.&lt;/p&gt;

&lt;h4&gt;
  
  
  Generate a GPG Key
&lt;/h4&gt;

&lt;blockquote&gt;
&lt;p&gt;GitHub has phenomenal instructions for this, these instructions are inspired from &lt;a href="https://help.github.com/en/github/authenticating-to-github/generating-a-new-gpg-key"&gt;this guide&lt;/a&gt;&lt;sup&gt;3&lt;/sup&gt;.  If something in this guide does not work for you, I recommend that you open GitHub's guide and follow it, this will focus on the happy path of GPG key generation.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you have just installed gnupg, you should have a version greater than &lt;code&gt;2.1.17&lt;/code&gt;, so you can run this command to start the key generation process:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;gpg &lt;span class="nt"&gt;--full-generate-key&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then, when asked for the type of key, press &lt;code&gt;Enter&lt;/code&gt; to accept the default of &lt;code&gt;RSA&lt;/code&gt; for both the private and public keys.&lt;/p&gt;

&lt;p&gt;Enter your desired key size, a key of at least &lt;code&gt;4096&lt;/code&gt; bits is recommended.&lt;/p&gt;

&lt;p&gt;Enter the length of time you wish the key to be valid for, Pressing &lt;code&gt;Enter&lt;/code&gt; will accept the default of never expiring. For this use case, that is perfectly acceptable, since if the GPG key ever gets compromised you can delete it from GitHub.&lt;/p&gt;

&lt;p&gt;Verify your selections, and then enter your user ID information. &lt;em&gt;A tip from GitHub - If you would like to keep your email private, use your GitHub-provided &lt;code&gt;no-reply&lt;/code&gt; email address&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;Type a secure passphrase - I recommend using a password generator to make a suitably long password, however, you should keep your password below 100 characters since &lt;a href="https://gpgtools.tenderapp.com/discussions/problems/59310-gpg-keychain-password-length-is-limited-to-100-characters-or-less"&gt;this toolchain has had issues with longer passwords in the past&lt;/a&gt;.  You should save this password in a password manager, I personally use BitWarden!&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Congratulations! You have created a GPG key!&lt;/b&gt;&lt;br&gt;
Now, it needs to be added to git and GitHub.&lt;/p&gt;
&lt;h4&gt;
  
  
  Adding your GPG key to Git
&lt;/h4&gt;

&lt;p&gt;List your secret gpg keys, which is the portion of the key required to sign your commits and tags:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;gpg &lt;span class="nt"&gt;--list-secret-keys&lt;/span&gt; &lt;span class="nt"&gt;--keyid-format&lt;/span&gt; LONG
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;In the list of keys, select the secret key id (&lt;code&gt;sec&lt;/code&gt;) that you would like to use.  In this example, the GPG key ID is &lt;code&gt;7FF2A19983627EC2&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;gpg &lt;span class="nt"&gt;--list-secret-keys&lt;/span&gt; &lt;span class="nt"&gt;--keyid-format&lt;/span&gt; LONG
/Users/username/.gnupg/secring.gpg
&lt;span class="nt"&gt;------------------------------------&lt;/span&gt;
sec   4096R/7FF2A19983627EC2 2020-01-02 &lt;span class="o"&gt;[&lt;/span&gt;expires: 2022-01-01]
uid                          Username 
ssb   4096R/24F148EA2DB78C3B 2020-01-02
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;We will configure git to use our key to sign all commits.&lt;/p&gt;

&lt;p&gt;You must use your GPG secret key ID in the following commands.&lt;/p&gt;

&lt;p&gt;First, tell git which GPG key to use, then, tell git to automatically GPG sign every commit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;git config &lt;span class="nt"&gt;--global&lt;/span&gt; user.signingkey 7FF2A19983627EC2
git config &lt;span class="nt"&gt;--global&lt;/span&gt; commit.gpgsign &lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Now, create a test git repository with a new GPG signed commit! You will need to enter the GPG password the first time you use it, and Pinentry will allow you to save this password to your keychain so that you will not need to re-authenticate in the future.&lt;/p&gt;

&lt;p&gt;After committing, you can test the new signature, by running this command to ask git to verify the signature:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;git log &lt;span class="nt"&gt;--show-signature&lt;/span&gt; &lt;span class="nt"&gt;-1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;h4&gt;
  
  
  Adding your GPG key to GitHub
&lt;/h4&gt;

&lt;p&gt;The last phase is to add your GPG key to GitHub, without doing this step, all commits will show as 'Unverified'.  This fact also allows us to revoke a GPG key in the future, as if it gets compromised we can delete it from GitHub.&lt;/p&gt;

&lt;p&gt;Using your same GPG Key ID from above, we need to export the key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;gpg &lt;span class="nt"&gt;--armor&lt;/span&gt; &lt;span class="nt"&gt;--export&lt;/span&gt; 7FF2A19983627EC2 | pbcopy
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Then, in your GitHub Settings, select SSH and GPG keys, click 'New GPG key' and paste your key!&lt;/p&gt;

&lt;p&gt;Again, &lt;a href="https://help.github.com/en/github/authenticating-to-github/adding-a-new-gpg-key-to-your-github-account"&gt;GitHub has a fantastic illustrated guide for this&lt;/a&gt; if you get stuck.&lt;/p&gt;

&lt;p&gt;Push your test commit from the previous phase, and when you view the commits, it will show up as 'Verified'!&lt;/p&gt;

&lt;p&gt;🎉🎉🎉&lt;/p&gt;

&lt;p&gt;That's it! You have now configured your computer to auto GPG sign your commits and therefore provide a mechanism to guard and verify your identity as a software engineer!&lt;/p&gt;

&lt;h5&gt;
  
  
  References
&lt;/h5&gt;

&lt;ol&gt;
&lt;li&gt;GnuPG - &lt;a href="https://gnupg.org/"&gt;https://gnupg.org/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Pinetry - &lt;a href="https://gnupg.org/related_software/pinentry/index.html"&gt;https://gnupg.org/related_software/pinentry/index.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Generating a new GPG key - &lt;a href="https://help.github.com/en/github/authenticating-to-github/generating-a-new-gpg-key"&gt;https://help.github.com/en/github/authenticating-to-github/generating-a-new-gpg-key&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>gpg</category>
    </item>
    <item>
      <title>Angular for GitHub Pages</title>
      <dc:creator>Brandon Ward</dc:creator>
      <pubDate>Sat, 04 Jan 2020 21:07:33 +0000</pubDate>
      <link>https://dev.to/bwvolleyball/angular-for-github-pages-2ml2</link>
      <guid>https://dev.to/bwvolleyball/angular-for-github-pages-2ml2</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This is the story of my personal journey to deploying an Angular app as my GitHub Pages website, for some, it may even serve as a guide!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Before we begin
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Important Tools&lt;/em&gt;&lt;br&gt;
&lt;a href="https://cli.angular.io/"&gt;https://cli.angular.io/&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.npmjs.com/package/angular-cli-ghpages"&gt;https://www.npmjs.com/package/angular-cli-ghpages&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/features/actions"&gt;https://github.com/features/actions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Source Code:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://github.com/Bwvolleyball/bwvolleyball-github-io-src"&gt;https://github.com/Bwvolleyball/bwvolleyball-github-io-src&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Published Code:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://github.com/Bwvolleyball/bwvolleyball.github.io"&gt;https://github.com/Bwvolleyball/bwvolleyball.github.io&lt;/a&gt;&lt;br&gt;
&lt;em&gt;Final Product 🎉:&lt;/em&gt;&lt;br&gt;
&lt;a href="https://bwvolleyball.github.io"&gt;https://bwvolleyball.github.io&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Goal
&lt;/h2&gt;

&lt;p&gt;The primary goal of this story (or guide) is to create a GitHub pages website that requires no maintenance to deploy or keep up to date. One of the promises for a traditional GitHub pages website is that new source code is automatically deployed to the pages website upon commit. The issue with an Angular application is that it needs to be built / compiled / transpiled (in the case of TypeScript) before it can be displayed as a static web page.&lt;/p&gt;


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

&lt;p&gt;First, generate and commit a starter angular application to the source code repository.&lt;/p&gt;

&lt;p&gt;To generate a new Angular app, use the Angular Cli:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ng new bwvolleyball-github-io-src
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; git remote add origin git@github.com:Bwvolleyball/bwvolleyball-github-io-src.git

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Next, we need to add the angular-cli-ghpages tool to our application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;cd &lt;/span&gt;bwvolleyball-github-io-src/
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; ng add angular-cli-ghpages
&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; git commit &lt;span class="nt"&gt;-m&lt;/span&gt; &lt;span class="s2"&gt;"Adding Angular GitHub pages plugin"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Finally, we need to add the GitHub Actions deployment job.&lt;br&gt;
create &lt;code&gt;.github/workflows/push-to-gh-pages.yml&lt;/code&gt; with the following contents:&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 Github Pages&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="c1"&gt;# - only push to GitHub pages from the master branch&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&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;strategy&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="na"&gt;matrix&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;12.x&lt;/span&gt;&lt;span class="pi"&gt;]&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;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v1&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;Use Node.js ${{ matrix.node-version }}&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/setup-node@v1&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;node-version&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ matrix.node-version }}&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;npm install, build, and test&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 -g @angular/cli&lt;/span&gt;
        &lt;span class="s"&gt;npm ci&lt;/span&gt;
        &lt;span class="s"&gt;ng deploy --repo=https://github.com/bwvolleyball/bwvolleyball.github.io.git --name=bwvolleyball --email=$EMAIL --message="Built from ${GITHUB_SHA} in the source repository." --branch=master&lt;/span&gt;
      &lt;span class="na"&gt;env&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
        &lt;span class="na"&gt;CI&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="no"&gt;true&lt;/span&gt;
        &lt;span class="na"&gt;GH_TOKEN&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.GithubToken }}&lt;/span&gt;
        &lt;span class="na"&gt;EMAIL&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;${{ secrets.Email }}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The most important parts of this build is that it:&lt;br&gt;
a) installs the angular cli to build the application.&lt;br&gt;
b) installs all dependencies in ci mode (more on that below).&lt;br&gt;
c) deploys the project to my GitHub pages repository, on the master branch, with a commit message that contains the commit sha of the source repo for traceability.&lt;br&gt;
&lt;a href="https://github.com/Bwvolleyball/bwvolleyball-github-io-src/blob/master/.github/workflows/push-to-gh-pages.yml"&gt;The source file of this build is here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;All this is great, but we have more work to do before this will actually work.&lt;br&gt;
You might have noticed the environment variables at the end of the build file, here’s a breakdown of what they do:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;CI&lt;/code&gt; sets the ci flag for NPM. This is useful in case we accidentally ran &lt;code&gt;npm install&lt;/code&gt; as that environment variable will still guarantee that ci mode is on and that the application installs dependencies strictly from the &lt;code&gt;package-lock.json&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;GH_TOKEN&lt;/code&gt; must be a Github Access Token so that the GitHub pages angular plugin has write access to your pages repo. Assuming your pages repo is public, you need to generate a token (&lt;a href="https://github.com/settings/tokens/new"&gt;link here&lt;/a&gt;) with only the &lt;code&gt;public_repo&lt;/code&gt; permission (Less is more when it comes to security). This is a password that allows the build to push to the GitHub pages repo as me.
This is a requirement of the angular-cli-ghpages tool we are using to publish / deploy our GitHub pages site.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;EMAIL&lt;/code&gt; the most straight forward, I placed my email in a secret so that it’s not just sitting in the repository.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to add the secrets:
&lt;/h2&gt;

&lt;p&gt;By now you should have also noticed that &lt;code&gt;GH_TOKEN&lt;/code&gt; and &lt;code&gt;EMAIL&lt;/code&gt; are populated by secrets. In short, this is the mechanism GitHub Actions provides for encrypted build information.&lt;br&gt;
From the repository that you are committing the source code to, select the Settings &amp;gt; Secrets menu, and enter your secrets:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--z0KvVkx7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/t65iff62amp4dkssn70n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--z0KvVkx7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/t65iff62amp4dkssn70n.png" alt="Adding Secrets to the source repository."&gt;&lt;/a&gt;&lt;/p&gt;
Adding secrets to the source repository.



&lt;p&gt;Once the secrets are entered, I can retrieve them directly from my GitHub Actions build as &lt;code&gt;${{ secrets.[SECRET_NAME] }}&lt;/code&gt;. I then inject these secrets into my build environment.&lt;/p&gt;

&lt;p&gt;When you have these secrets set up on the source repository, it’s time to push our repo to GitHub and let it build! If everything is configured correctly, you’ll have a new environment tab on your GitHub pages repo after the build, and it’ll show that your pages application was just deployed:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DgHCJEY4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/b7b7m3ovaudzg49jfk31.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DgHCJEY4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/b7b7m3ovaudzg49jfk31.png" alt="Environment Tab"&gt;&lt;/a&gt;&lt;/p&gt;
The `environment` tab now has 1 item.




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lGclY2rM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qql4plthk92y8abmv9bv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lGclY2rM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://thepracticaldev.s3.amazonaws.com/i/qql4plthk92y8abmv9bv.png" alt="Activity Log"&gt;&lt;/a&gt;&lt;/p&gt;
Activity log of recent deployments.




&lt;p&gt;Thanks for coming along on this journey with me! As a reminder, all the source code and tools used to achieve this are listed at the top of this post. I am excited to finally have a zero-maintenance Angular GitHub Pages site!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Editor's Note&lt;/em&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This blog originally appeared on Medium, however, I do not appreciate Medium's style of business, &lt;a href="https://medium.com/@seangwright/im-moving-my-blog-to-dev-to-646b842ffd61"&gt;see these thoughts&lt;/a&gt;.  I will not link to the original Medium blog post as I intend to delete it.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>angular</category>
      <category>github</category>
    </item>
  </channel>
</rss>
