#5 – Migrating from Wordpress

April 09, 2018

I have been thinking to ditch Wordpress and host my own blog for a while. It's not that I hate using Wordpress now, on the contrary, they are really simple and useful. But as a man get older, they want to have more complex responsibilities 😂. I really want to make a blog using simple static pages and with markdown supported, like Jekyll. On the other hand I need to make a single page profile and a custom domain for it. And so here we are combining the two into one site.

This site was built using Gatsby, since I love NodeJS. And I found that Google Cloud was rebranded(?) into Firebase so I tried that too. Currently since the traffic is nonexistent, I shouldn't even pay a penny anyway. But what I want to talk about is code automation. I have never been this late to learn that it's very cool (well, besides unit testing, it took me a long time to understand why I need it). I used a simple deployment scheme with Bitbucket Pipeline. Using only this simple script:

image: node:8.11.1

pipelines:
  default:
    - step:
        caches:
          - node
        script:
          - npm install
          - npm run build
          - npm run deploy

It builds and deploys the code to Firebase on each push. The npm run build runs gatsby build, and npm run deploy runs firebase deploy.

Oh yeah, about migrating posts from Wordpress. I only need the last 4 posts from the blog anyway, so I didn't write script or anything. I just exported those posts and rewrote them as markdown. So, that's that.