--- tags: git, blogs title: Publishing Blog Post to Dev.to using GitHub CI/CD Pipeline description: Publishing Blog Post to Dev.to using GitHub CI/CD Pipeline image: https://i.imgur.com/6gxkEV3.jpg author: Rupesh Tiwari --- # Publishing Jekyll Blog Post to Dev.to using GitHub CI/CD Pipeline If you have a blogging site using **Jekyll** and you want to publish your blogs to your **[Dev.To](https://dev.to)** account? Then read this article. ## Jekyll Project I have my Jekyll project and I do have 1 post. ![](https://i.imgur.com/IpE6Lxb.png) ## Publish to dev.to Action I will use pre-built action by [sinedied/publish-devto](https://github.com/sinedied/publish-devto) to publish my post to dev.to. [Market Place Publish to dev.to Action](https://github.com/marketplace/actions/publish-to-dev-to) ![](https://i.imgur.com/lJzRaRi.png) ## dev.to Front Matter Guidelines Make sure you have below attributes in your blog post Front Matter. Custom variables set for each post, located between the triple-dashed lines in your editor. Here is a list of possibilities: **title**: the title of your article **published**: boolean that determines whether or not your article is published **description**: description area in Twitter cards and open graph cards **tags**: max of four tags, needs to be comma-separated **canonical_url**: link for the canonical version of the content **cover_image**: cover image for post, accepts a URL. The best size is 1000 x 420. **series**: post series name. ### ✍ Markdown Basics Below are some examples of commonly used markdown syntax. If you want to dive deeper, check out [this cheat sheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Here-Cheatsheet). ## Creating API Keys in Dev.To Login to dev.to and then go to accounts and create new api key. ![](https://i.imgur.com/7ePWc0H.png) ## Creating Github Workflow Lets create ".github/workflows/publish.yml" file. ![](https://i.imgur.com/UOlHCHi.png) It will publish post to dev.to/roopkt whenever merge or push happens to master branch. ```yaml= name: publish on: push: branches: - master jobs: publish: runs-on: ubuntu-latest if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')" steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: 12 - name: Publish articles on dev.to uses: "sinedied/publish-devto@30728bf" with: files: '_posts/**/*.md' devto_key: ${{ secrets.DEVTO_TOKEN }} github_token: ${{ secrets.GH_TOKEN }} conventional_commits: true ``` ## Run GitHub CI/CD Lets update post and push the code to master branch. ![](https://i.imgur.com/YXoXUh9.png) ## Confirm published article on dev.to account Notice my post published in https://dev.to/roopkt ![](https://i.imgur.com/OW01PLR.png) ![](https://i.imgur.com/xJXovX4.png) Here is my article published : ["Enforcing Dependency Constraints in Nx Monorepo Projects"](https://dev.to/roopkt/enforcing-dependency-constraints-in-nx-monorepo-projects-3ldj) ## Skipping GitHub CI Sometime you are not updating your blog rather fixing your site or updating about me or something else. And you don't want to trigger your CI so make sure you add `[skip ci]` in your commit comments. So that your blogs will be not published because CI will not trigger. ![](https://i.imgur.com/Mj2nC8m.png) Notice we have check in our Job to not run if message has '[skip ci]' ![](https://i.imgur.com/UNbCUX9.png) ## Other Blogs https://www.mariokandut.com/how-to-automatically-post-from-gatsby-to-medium-and-dev-to/ > IMPORTANT: The synced posts will be in your dashboards as drafts, so you can double check them. If you want fully auto-posting contact the admins and give them the right to set your posts to public. (send an email to yo@dev.to). --- ## Do You Want to become full stack developer? 💻 If you want to become full stack developer and grow your carrier as Lead Developer/Architect. Consider subscribing to our full stack development training programs. We have monthly membership plans and you will get unlimited access to all of our video courses, slides, source code & Monthly video calls. - Please visit www.fullstackmaster.net/pro to subscribe to All Access PRO membership. - Please visit www.fullstackmaster.net/elite to subscribe to All Access ELITE membership. You will get everything from PRO plan. Additionally you will get access to monthly live Q&A video call with Rupesh and ask doubts and get more tips and tricks. > You bright future is waiting for you so visit today www.fullstackmaster.net and allow me to help you to board on your dream software architect/lead role. ### :sparkling_heart: Contact Details: Say :wave: to me! Rupesh Tiwari\ www.rupeshtiwari.com \ ✉️ <fullstackmaster1@gmail.com> \ Founder of [www.fullstackmaster.net](https://www.fullstackmaster.net) 🎓 [<img src="https://i.imgur.com/9OCLciM.png" width="295" height="65">](http://www.fullstackmaster.net)