<?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: Abdul Rahim Shaikh</title>
    <description>The latest articles on DEV Community by Abdul Rahim Shaikh (@ariskycode).</description>
    <link>https://dev.to/ariskycode</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%2F463999%2F29893eb9-8cc8-47be-aa76-25fc70a63c13.png</url>
      <title>DEV Community: Abdul Rahim Shaikh</title>
      <link>https://dev.to/ariskycode</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ariskycode"/>
    <language>en</language>
    <item>
      <title>First post and IT'S AUTOMATED</title>
      <dc:creator>Abdul Rahim Shaikh</dc:creator>
      <pubDate>Fri, 30 Oct 2020 18:44:41 +0000</pubDate>
      <link>https://dev.to/ariskycode/first-post-and-it-s-automated-laa</link>
      <guid>https://dev.to/ariskycode/first-post-and-it-s-automated-laa</guid>
      <description>&lt;p&gt;Do you prefer writing your blogs in a IDE/notepad rather than a website where you can open youtube in the next tab and spend a millenia procrastinating?&lt;/p&gt;

&lt;p&gt;Well now you can... You could have for a while, but now for sure.&lt;/p&gt;

&lt;p&gt;Credits to &lt;a href="https://github.com/maxime1992"&gt;Maxime&lt;/a&gt; who created the &lt;a href="https://github.com/maxime1992/dev-to-git"&gt;dev-to-git&lt;/a&gt; tool that takes your markdown files and publishes them in dev.to and &lt;a href="https://github.com/beeman"&gt;Bram Borggreve&lt;/a&gt; for creating a tutorial using Github Actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1 - DEV.TO API Key
&lt;/h3&gt;

&lt;p&gt;Log in to your dev.to account, go into settings. You will find a DEV API Keys section under the Account tab. Give it a description if you want to, it's nice to know what you used it for if you have multiple keys. Click on Generate to generate your key.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RWbbIqBE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/generate-dev-key.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RWbbIqBE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/generate-dev-key.png" alt="Generate DEV.TO API Key by giving a description and clicking on the Generate button" title="Generate DEV.TO API Key"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When generated, the key will show up under active keys dropdown and will have a set of random characters with it. This is your token that you can use to access any of the dev.to API.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lXaaN5UE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/get-dev-key-token.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lXaaN5UE--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/get-dev-key-token.png" alt="Generated DEV.TO API Key" title="Generated DEV.TO API Key"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;We will be needing this key when we set up the Github Actions workflow.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2 - Create your Github Repository
&lt;/h3&gt;

&lt;p&gt;Here, it is all upto you. You want to create a repo for each blog post or a mono repo with all dev.to blog posts. You can start from scratch and add a package.json and a workflow yaml or you can use &lt;a href="https://github.com/maxime1992/dev.to"&gt;Maxime's dev.to template&lt;/a&gt;. The template is really helpful if you don't want to spend time setting things up. You can simply clone it and start writing. Maxime's template works for Travis CI so, we will start from scratch this time and refer to &lt;a href="https://dev.to/beeman/automate-your-dev-posts-using-github-actions-4hp3"&gt;beeman's blog for github actions&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Create an empty repository.&lt;br&gt;
Add the following &lt;code&gt;package.json&lt;/code&gt; for setting up dependencies.&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dev.to"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"repository"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"git"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://github.com/ariskycode/dev.to-blogs.git"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prettier"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"prettier"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"embedme"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"embedme blog-posts/**/*.md"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prettier:base"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"yarn run prettier &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;**/*.{js,json,scss,md,ts,html,component.html}&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prettier:write"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"yarn run prettier:base --write"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prettier:check"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"yarn run prettier:base --list-different"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"embedme:check"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"yarn run embedme --verify"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"embedme:write"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"yarn run embedme"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dev-to-git"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"dev-to-git"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"dependencies"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"dev-to-git"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.1.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"embedme"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.11.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"prettier"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"1.18.2"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"yarn"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"^1.22.10"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;You would now need to create a &lt;code&gt;dev-to-git.json&lt;/code&gt; file in the root directory of your repository. The dev-to-git tool would be using this file to publish your blogs.&lt;br&gt;
It is a simple array to hold all the blogs you want and each json object has two fields: &lt;code&gt;id&lt;/code&gt; and &lt;code&gt;relativePathToArticle&lt;/code&gt;. We will see how to retrieve this id when we create our first blog post.&lt;/p&gt;




&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;502153&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"relativePathToArticle"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"./blog-posts/first-post-and-its-automated/first-post-and-its-automated.md"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;We have used two dependencies; prettier and embedme. &lt;a href="https://github.com/prettier/prettier"&gt;Prettier&lt;/a&gt; is for linting and can automatically fix issues in your repo. &lt;a href="https://github.com/zakhenry/embedme"&gt;Embedme&lt;/a&gt; is used for embedding source code snippets into readmes, you simply provide the path and run embedme.&lt;br&gt;
So before we push anything we can run &lt;code&gt;yarn run prettier:check&lt;/code&gt; to check for linting issues and automatically fix them with &lt;code&gt;yarn run prettier:write&lt;/code&gt; and run embedme &lt;code&gt;yarn run embedme:verify&lt;/code&gt; to check if all paths are correct and &lt;code&gt;yarn run embedme&lt;/code&gt; to create the embeded readme.&lt;/p&gt;

&lt;p&gt;We will be adding these commands to the workflow so that builds would break if anything is out of place and nothing incorrect is published.&lt;/p&gt;

&lt;p&gt;We are ready with the basic repository setup, now on blog writing.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 3 - Add your first automated post
&lt;/h3&gt;

&lt;p&gt;Now to create your first post. Currently Maxime and Bram are working automating creation of new posts, so you would have to create one manually.&lt;/p&gt;

&lt;p&gt;Login to your dev.to account. Click on Write Post button in the nav bar. You would only need to create a draft, so add a title and click on save draft.&lt;br&gt;
Once your draft is saved, an id would be generated from dev.to for your post. We would be using this id as a reference to this post.&lt;br&gt;
To retrieve the id, you can run the following command in your browser console.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;$&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;div[data-article-id]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;getAttribute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;data-article-id&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can use this id and add it to &lt;code&gt;dev-to-git.json&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The package structure is completely upto you, but remember to give the correct path in &lt;code&gt;relativePathToArticle&lt;/code&gt;. Here I have the directory blog-posts and will create folders for each blog post.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--oXPWkAOl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/tree.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--oXPWkAOl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/tree.png" alt="Project Structure" title="Project Structure"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In your blog-name.md, you would need to add certain tags that would help you maintain everything from the repository itself.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;---
published: true
title: "First post and IT'S AUTOMATED"
cover_image: ""
description: Create a post that is version controlled in Github and auto-published using Github Actions
tags: devto, publication, blogpost, continuousdeployment, github
series:
canonical_url:
---
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is awesome as you can directly publish updates without visiting dev.to. This tool also allows you to keep all you images locally and then their links would be converted to remote links before publishing, so now even images are version controlled.&lt;br&gt;
To make sure that all your images are linked correctly, make sure your package.json has the correct &lt;code&gt;repository-url&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 4 - Set up workflow
&lt;/h3&gt;

&lt;p&gt;Setting up the Github Actions workflow is very simple.&lt;/p&gt;

&lt;p&gt;Github Actions is basically a CI/CD tool that allows you to build, test and deploy your code as per steps defined in your workflows folder.&lt;br&gt;
Create a .github directory in the root directory and within that create a workflows folder.&lt;br&gt;
In the workflows folder, we will now define a yaml that will contain the steps the pipeline will run.&lt;/p&gt;




&lt;div class="highlight js-code-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;Publish&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;main&lt;/span&gt;
  &lt;span class="na"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;branches-ignore&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;main&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;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Publish&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 Repo&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@master&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;Setup Nodejs&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="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;12.x"&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 dependencies&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yarn install&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;Run Prettier&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yarn run prettier:check&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;Run Embedme&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;yarn run embedme:check&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 to dev.to&lt;/span&gt;
        &lt;span class="na"&gt;run&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;DEV_TO_GIT_TOKEN=${{ secrets.DEV_TO_GIT_TOKEN }} yarn run dev-to-git&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is a simple workflow that will checkout your repository, install the dependencies, run prettier and embedme and then run the dev-to-git tool which will publish your posts to dev.to.&lt;/p&gt;

&lt;p&gt;You would notice there is &lt;code&gt;secrets.DEV_TO_GIT_TOKEN&lt;/code&gt; parameter in the dev-to-git step. You can add secrets to your repository so that no one else uses the API token you created in step 1. To add this to your repository, go into your repository settings. You will see a Secrets section. Add your API Key as a new secret and save it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RHpschj7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/github-secrets.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RHpschj7--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/github-secrets.png" alt="Github Secrets" title="Add your secret here"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we are all done! All that is left is commit and push to your local repository!&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 5 - Publish your first post
&lt;/h3&gt;

&lt;p&gt;Once you push your these changes to your master/main branch, Github Actions will automatically detect the presence of a workflow and start executing that for you.&lt;/p&gt;

&lt;p&gt;If you want to see how your last deployment went or any previous history you can visit the Action tab on your Github repository&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ig9Hcx6Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/actions.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ig9Hcx6Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/actions.png" alt="Github Actions Workflows" title="You can see that our publish workflow successfully executed"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we click on the workflow we can see all the steps and their logs.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8jS2lH1N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/publish-workflow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8jS2lH1N--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/publish-workflow.png" alt="Publish Workflow steps" title="Publish Workflow steps"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If any of these steps fail we can see the logs here and fix the issues.&lt;/p&gt;

&lt;p&gt;Your blog is now and you're all done!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Qv4rWbfz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/its-done.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Qv4rWbfz--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/its-done.jpg" alt="It is done" title="It's done, Sam. It's over."&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 6 - Profit?
&lt;/h3&gt;

&lt;p&gt;Another neat trick I learnt on dev.to is dev.to allows monetizing your blog posts. Though this is only a beta feature, but the hype is catching on.&lt;br&gt;
Web Monetization is making its move direct to content creators, Monetization Providers allow you to create a payment pointer(like a paypal id and all money will redirected there) that is linked to you wallet.&lt;br&gt;
All you need to do is sign up with a provider, link your wallet and add this little snippet to all your sites.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;meta&lt;/span&gt; &lt;span class="na"&gt;name=&lt;/span&gt;&lt;span class="s"&gt;"monetization"&lt;/span&gt; &lt;span class="na"&gt;content=&lt;/span&gt;&lt;span class="s"&gt;"your payment pointer"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can checkout &lt;a href="https://dev.to/hacksultan/web-monetization-like-i-m-5-1418"&gt;Hack Sultan's explanation of Web Monetization&lt;/a&gt; to understand it better and it also has steps on signing up for this.&lt;/p&gt;

&lt;p&gt;Dev.to handles the meta tags for you. To set this up in Dev.to, go into your Settings and in the Misc Section you can add your payment pointer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--qTsp_k23--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/web-monetization.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--qTsp_k23--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/ariskycode/dev.to-blogs/main/blog-posts/first-post-and-its-automated/assets/web-monetization.png" alt="Dev.to enables web monetization in Misc settings" title="Infinite money, baby!"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Voila! No ads and you still earn!&lt;/p&gt;

&lt;h2&gt;
  
  
  Thank you for reading!
&lt;/h2&gt;

&lt;p&gt;Thank you for reading and be sure to checkout the sources, they have created some other amazing stuff as well.&lt;/p&gt;

&lt;p&gt;If you see any mistakes, you can raise a PR to &lt;a href="https://github.com/ariskycode/dev.to-blogs"&gt;my dev.to blog repository&lt;/a&gt; with the neccessary changes and we can get them added to the post!&lt;/p&gt;

</description>
      <category>devto</category>
      <category>blogpost</category>
      <category>continuousdeployment</category>
      <category>github</category>
    </item>
  </channel>
</rss>
