From 6104ad1cf958d79501700e81241a3088e5935bdc Mon Sep 17 00:00:00 2001 From: Bitomule Date: Sun, 3 May 2020 08:49:07 +0000 Subject: [PATCH] Commit new output --- Output/feed.rss | 43 +++++++++++++++++++++++++++++++++- Output/index.html | 2 +- Output/sitemap.xml | 2 +- Output/tags/blog/index.html | 2 +- Output/tags/index.html | 2 +- Output/tags/publish/index.html | 2 +- Output/tags/web/index.html | 2 +- 7 files changed, 48 insertions(+), 7 deletions(-) diff --git a/Output/feed.rss b/Output/feed.rss index a6875cf..e537c20 100644 --- a/Output/feed.rss +++ b/Output/feed.rss @@ -1,4 +1,45 @@ -Bitomule's learning shackMy thoughts about iOS, technology or any other thing that comes to my mind.https://blog.bitomule.comenSun, 3 May 2020 08:46:29 +0000Sun, 3 May 2020 08:46:29 +0000250https://blog.bitomule.com/posts/introducing-swiftypodsIntroducing SwiftyPods: generate your podfile using Swifthttps://blog.bitomule.com/posts/introducing-swiftypodsWed, 22 Apr 2020 19:36:00 +0000I’ve been working on this for weeks and today I am happy to finally share it with you.

SwiftyPods started with me exploring options to improve how we create feature modules at Wallapop. You can see my talk at NSSpain here about our approach to modules.

One of the first issues I saw is that our project had one single podfile including dependencies from main app and modules. We think that the long term solution will be getting our modules closer to Swift package manager but we are not there yet (hopefully SPM 5.3 with binaries support and assets will get us closer).

I have been interested in building a command line tool using Swift for long time, so it looked like the perfect opportunity to solve the problem using one.

I am not sure yet if it will be useful for us or if just and experiment. What I know is that I had a lot of fun building it.

Keep reading if you want some details about the implementation; if you just want to use it go to the repo at github (I think I made it easy to use).

DSL

The domain specific language built for SwiftyPods is the first thing I created as a proof of concept and is one of the last things I finished. Right now I like the result although it is missing a lot of features.

I built it trying to be as close to Swift Package Manager and also trying to make it easier to grow in the future without breaking changes.

The result is:

let podfile = Podfile(
+Bitomule's learning shackMy thoughts about iOS, technology or any other thing that comes to my mind.https://blog.bitomule.comenSun, 3 May 2020 08:49:01 +0000Sun, 3 May 2020 08:49:01 +0000250https://blog.bitomule.com/posts/automating-deploy-of-your-publish-site-to-github-pagesAutomating deploy of your publish site to github pageshttps://blog.bitomule.com/posts/automating-deploy-of-your-publish-site-to-github-pagesFri, 1 May 2020 10:05:00 +0000This is the second post about Publish, the static website building tool by John Sundell.

I have already shared how to get started and today we will focus on publishing the website.

As today Publish does not include an official method to deploy to github pages but a PR is already open. Although we don’t have that support we can publish just using the github deploy method.

Creating the repo

In order to deploy your blog in Github Pages you have to create a new repository where only the published blog will live. This means that if you already have a repo with your site source code, you will have to create a new one to host the static files.

Just create an empty Github repository and you are good to go.

Deploy

On the previous post we created our own theme, but we didn’t focus much in the publish method. It may look like this right now:

try Blog().publish(
+    withTheme: .blog
+)
+

This is just enough to generate a site that you can manually upload to whatever hosting you choose. If you want publish to deploy the site for you, you need to add the deployUsing argument. In our case we want to deploy using github so it will look like:

try Blog().publish(
+    withTheme: .blog,
+    deployedUsing: .gitHub("yourusername/yourrepo"),
+)
+

Use the repo you have just created as the target repository and now you can just run:

publish deploy
+

Then Publish will deploy the generated files to your empty repo. You can use this command each time you want to deploy your site.

Enabling github pages

In order to activate your site, you have to enable Github Pages for the repository with your static files. To do that just go to your repository settings, scroll down to GitHub Pages and configure it. You can use a custom domain if you want to and choose master as the source (that is why you have a repo with site content only).

This will create a CNAME file in your repository telling GitHub the domains it can handle. Also keep in mind you will have to change your domain DNS CNAME registry to your Github page url.

If you prefer to use https with a custom domain you will have to use Cloudflare (A free CDN service) that will also improve your site speed. Please let me know if you are interested in a blog post about the Cloudflare setup.

Automating

Right now you should have your website running, available to the public and deployed using a one line command.

This is good enough for most people, but we can go one step further and make it automatic so a new website version will be deployed each time we commit changes to our blog repository.

We can do this for free using Github Actions. We will create a new Github Action workflow in the repo that hosts our blog source that will:

  • Launch a macOS virtual machine
  • Checkout our repo
  • Generate static files
  • Publish to your Github Pages repository
  • Commit changes to source repo (you can skip this one and ignore output folder in your source repo)

In order to create your first Github Action, go to the Actions tab in your source repo and tap New Workflow. You may choose the getting started Workflow and delete all the content.

Here you have the YAML file I use in my own repo:

name: Publish
+
+on:
+  push:
+    branches: [ master ]
+
+jobs:
+  build:
+    runs-on: macOS-latest
+
+    steps:
+    - uses: actions/checkout@v2
+  
+    - name: Generate blog
+      run: swift run Blog
+    - name: Publish in github pages repo
+      uses: crazy-max/ghaction-github-pages@v1.4.0
+      with:
+        repo: youruser/yourrepository
+        target_branch: master
+        keep_history: true
+        allow_empty_commit: false
+        build_dir: Output
+        committer_name: yourname 
+        commit_message: Update blog content
+      env:
+        GITHUB_PAT: ${{ secrets.REPO_TOKEN }}
+        
+    - name: Add & Commit changes
+      uses: EndBug/add-and-commit@v4.0.1
+      with:
+        author_name: yourname
+        message: Commit new output
+

The last step to get this working is creating a Github token with access to your Github Page repository and adding it inside your source repository Secrets as REPO_TOKEN (you can find secrets inside your repository settings).

Now each time you commit to the master branch of your source repository Github will publish the content for you. Isn’t it awesome?

Drafts

Automation feels like magic as you no longer have to go through Publish, but it also means that each time you commit your blogpost it will get published and all your readers can see it. To avoid this I created a drafts folder next to my blogposts. It is still possible to read them if people gets into the repository, but they are not available in the published website.

You can also use branches and even create pull requests if that makes sense to you.

iPad blogging

I’m not going to lie, I added all this automation because I wanted to write my blogposts using my iPad and running publish deploy from the iPad is just not possible (as today 😛).

My setup is quite easy but works really well:

  • I use Working copy to manage the repository. It is not a cheap application, but it does an amazing job if you want to have a git repository on your iOS device. The best feature of Working copy is that it shares you repository as a resource inside Files app and that means you can open and edit files from your repo inside other apps.
  • That other app, in my case, is iA Writer. I’ve been trying multiple markdown editing applications, but iA Writer has the support to open folders from Files sources and that is just what I need. I just have 2 folder references inside iA Writer: posts and drafts.
  • I have a custom shortcut to create metadata for each blog

So the process when I want to start a new blog post is: 1. Run a shortcut from my iPad home screen 2. Type tile and tags (I want to improve this step using Data Jar to have some already defined tags) 3. The shortcut opens iA Writer for me so I just have to create a new draft, paste metadata and start Writing.

Once the draft is ready to be published I just move it to the posts folder, push my repository to remote and Github Actions takes care of publishing it.

I hope you have enjoyed reading this and it helps you improve your blogging flow so you can share more interesting content with all your readers. Please let me know if you want to know more about something or there is something you missed 🙂.

]]>
https://blog.bitomule.com/posts/introducing-swiftypodsIntroducing SwiftyPods: generate your podfile using Swifthttps://blog.bitomule.com/posts/introducing-swiftypodsWed, 22 Apr 2020 19:36:00 +0000I’ve been working on this for weeks and today I am happy to finally share it with you.

SwiftyPods started with me exploring options to improve how we create feature modules at Wallapop. You can see my talk at NSSpain here about our approach to modules.

One of the first issues I saw is that our project had one single podfile including dependencies from main app and modules. We think that the long term solution will be getting our modules closer to Swift package manager but we are not there yet (hopefully SPM 5.3 with binaries support and assets will get us closer).

I have been interested in building a command line tool using Swift for long time, so it looked like the perfect opportunity to solve the problem using one.

I am not sure yet if it will be useful for us or if just and experiment. What I know is that I had a lot of fun building it.

Keep reading if you want some details about the implementation; if you just want to use it go to the repo at github (I think I made it easy to use).

DSL

The domain specific language built for SwiftyPods is the first thing I created as a proof of concept and is one of the last things I finished. Right now I like the result although it is missing a lot of features.

I built it trying to be as close to Swift Package Manager and also trying to make it easier to grow in the future without breaking changes.

The result is:

let podfile = Podfile(
     targets: [
         .target(
             name: "Target",
diff --git a/Output/index.html b/Output/index.html
index 73a6324..616ba80 100644
--- a/Output/index.html
+++ b/Output/index.html
@@ -1 +1 @@
-Bitomule's learning shack

Introducing SwiftyPods: generate your podfile using Swift

I wanted to create a Swift command line tool for months and finally I found the need. I just published it as an open source package available in homebrew and mint , a tool to generate using a Swift DSL your CocoaPods podfiles. I’ve learned a lot and I’ll try to share some of the details of the development process.

Getting started with publish

I just moved my blog to github pages using Publish and the first steps were consusing and difficult. John Sundell built an amazing tool, but a one man effort can't solve and document everything. I will write a series of posts about Publish trying to explain all the details to get a website up and running using Publish.

Moving blog again

I’ve moved my blog again after just a few months with a good reason.

My Journey from RxSwift to Combine

Some days Ago I decided it was the perfect time to start trying Combine by introducing it into my latest project and this is the story on what issues I’ve found, what I have learned and what I had to fix myself.

Introducing KitchenOrder

Today is a great day. After some days of talking with Apple review team, I got my next app approved, KitchenOrder. When I work on apps after work I use to work on apps I want to use. I use my knowledge to help with the problems I have but this time I’m releasing something different, in this case, the app was planned to solve a problem for my father.

Realm Type-Safe update

A few days ago, at work, my colleague informed me about an issue we were about to solve. He had to update a Realm object property as easy and as fast as possible because that process will happen tons of times. To do it he was about to use Realm Key-value coding and also the partial update option.

How YNAB changed my life

I’ve been trying to write this post for months, but important things take time and YNAB has been one of the key parts for some years. I discovered YNAB listening to a popular Spanish podcast a few years ago when I was working as a freelance and I was struggling to get my economy under control. Having to save VAT each quarter while living in Madrid paying all the expenses was really hard and each month there were new surprises usually related to the car. Ynab changed my life and in this post I'll explain why.

Tracking your site metrics without sacrificing​ user privacy

After having my blog up and running there was one piece missing, I didn't have any kind of tracking so it was impossible to know if people were reading me and what were they reading. Looks impossible, doesn't it?

Using portainer to manage container station

Today I want to share another experience with my NAS, in this case, I'll talk about how to replace container station with a better alternative called Portainer. As you may know, I've played with docker on my Qnap NAS. This has to lead me to hate container station software. It has too many limits and issues so as one of my experiments I wanted to find a replacement to it. The best replacement I've found is portainer and as always, when you know what you want the steps to do it are a lot easier.

Running a website from your Qnap NAS

The first proper post of the blog is something I don't do frequently: playing with the web. In this post, I'll explain how after some hours I got the blog running with a custom domain and SSL using docker in a qnap NAS. The process should work on any NAS (with Synology it could be even easier) but I'll explain it using the Qnap process.

Getting text size on iOS

Calculating size of texts is one of the most common questions when you start working on iOS. Soon you need to calculate the size of some UI element and frequently that includes text. I explored some of the ways to do it and here I give some insights from that exploration.

\ No newline at end of file +Bitomule's learning shack

Automating deploy of your publish site to github pages

I have already shared how to get started with Publish. Today I’ll share how I’m automating the deploy process using Github Actions and how it enabled editing from my iPad.

Introducing SwiftyPods: generate your podfile using Swift

I wanted to create a Swift command line tool for months and finally I found the need. I just published it as an open source package available in homebrew and mint , a tool to generate using a Swift DSL your CocoaPods podfiles. I’ve learned a lot and I’ll try to share some of the details of the development process.

Getting started with publish

I just moved my blog to github pages using Publish and the first steps were consusing and difficult. John Sundell built an amazing tool, but a one man effort can't solve and document everything. I will write a series of posts about Publish trying to explain all the details to get a website up and running using Publish.

Moving blog again

I’ve moved my blog again after just a few months with a good reason.

My Journey from RxSwift to Combine

Some days Ago I decided it was the perfect time to start trying Combine by introducing it into my latest project and this is the story on what issues I’ve found, what I have learned and what I had to fix myself.

Introducing KitchenOrder

Today is a great day. After some days of talking with Apple review team, I got my next app approved, KitchenOrder. When I work on apps after work I use to work on apps I want to use. I use my knowledge to help with the problems I have but this time I’m releasing something different, in this case, the app was planned to solve a problem for my father.

Realm Type-Safe update

A few days ago, at work, my colleague informed me about an issue we were about to solve. He had to update a Realm object property as easy and as fast as possible because that process will happen tons of times. To do it he was about to use Realm Key-value coding and also the partial update option.

How YNAB changed my life

I’ve been trying to write this post for months, but important things take time and YNAB has been one of the key parts for some years. I discovered YNAB listening to a popular Spanish podcast a few years ago when I was working as a freelance and I was struggling to get my economy under control. Having to save VAT each quarter while living in Madrid paying all the expenses was really hard and each month there were new surprises usually related to the car. Ynab changed my life and in this post I'll explain why.

Tracking your site metrics without sacrificing​ user privacy

After having my blog up and running there was one piece missing, I didn't have any kind of tracking so it was impossible to know if people were reading me and what were they reading. Looks impossible, doesn't it?

Using portainer to manage container station

Today I want to share another experience with my NAS, in this case, I'll talk about how to replace container station with a better alternative called Portainer. As you may know, I've played with docker on my Qnap NAS. This has to lead me to hate container station software. It has too many limits and issues so as one of my experiments I wanted to find a replacement to it. The best replacement I've found is portainer and as always, when you know what you want the steps to do it are a lot easier.

Running a website from your Qnap NAS

The first proper post of the blog is something I don't do frequently: playing with the web. In this post, I'll explain how after some hours I got the blog running with a custom domain and SSL using docker in a qnap NAS. The process should work on any NAS (with Synology it could be even easier) but I'll explain it using the Qnap process.

Getting text size on iOS

Calculating size of texts is one of the most common questions when you start working on iOS. Soon you need to calculate the size of some UI element and frequently that includes text. I explored some of the ways to do it and here I give some insights from that exploration.

\ No newline at end of file diff --git a/Output/sitemap.xml b/Output/sitemap.xml index affe498..bf65598 100644 --- a/Output/sitemap.xml +++ b/Output/sitemap.xml @@ -1 +1 @@ -https://blog.bitomule.com/postsdaily1.02020-05-03https://blog.bitomule.com/posts/introducing-swiftypodsmonthly0.52020-05-03https://blog.bitomule.com/posts/getting-started-with-publishmonthly0.52020-05-03https://blog.bitomule.com/posts/moving-blog-againmonthly0.52020-05-03https://blog.bitomule.com/posts/my-journey-from-rxswift-to-combinemonthly0.52020-05-03https://blog.bitomule.com/posts/kitchenordermonthly0.52020-05-03https://blog.bitomule.com/posts/realm-type-safe-update-2monthly0.52020-05-03https://blog.bitomule.com/posts/how-ynab-changed-my-lifemonthly0.52020-05-03https://blog.bitomule.com/posts/tracking-your-site-metrics-without-sacrifycing-user-privacymonthly0.52020-05-03https://blog.bitomule.com/posts/using-portainer-to-manage-container-stationmonthly0.52020-05-03https://blog.bitomule.com/posts/running-a-website-from-your-qnap-nasmonthly0.52020-05-03https://blog.bitomule.com/posts/calculate-text-sizemonthly0.52020-05-03https://blog.bitomule.com/drafts/Automating%20deploy%20of%20your%20publish%20site%20to%20github%20pagesmonthly0.52020-05-03https://blog.bitomule.com/drafts/My%20list%20of%20Publish%20pluginsmonthly0.52020-05-03https://blog.bitomule.com/drafts/My%20omnifocus%20shortcuts%20for%20iOSmonthly0.52020-05-03 \ No newline at end of file +https://blog.bitomule.com/postsdaily1.02020-05-03https://blog.bitomule.com/posts/automating-deploy-of-your-publish-site-to-github-pagesmonthly0.52020-05-03https://blog.bitomule.com/posts/introducing-swiftypodsmonthly0.52020-05-03https://blog.bitomule.com/posts/getting-started-with-publishmonthly0.52020-05-03https://blog.bitomule.com/posts/moving-blog-againmonthly0.52020-05-03https://blog.bitomule.com/posts/my-journey-from-rxswift-to-combinemonthly0.52020-05-03https://blog.bitomule.com/posts/kitchenordermonthly0.52020-05-03https://blog.bitomule.com/posts/realm-type-safe-update-2monthly0.52020-05-03https://blog.bitomule.com/posts/how-ynab-changed-my-lifemonthly0.52020-05-03https://blog.bitomule.com/posts/tracking-your-site-metrics-without-sacrifycing-user-privacymonthly0.52020-05-03https://blog.bitomule.com/posts/using-portainer-to-manage-container-stationmonthly0.52020-05-03https://blog.bitomule.com/posts/running-a-website-from-your-qnap-nasmonthly0.52020-05-03https://blog.bitomule.com/posts/calculate-text-sizemonthly0.52020-05-03https://blog.bitomule.com/drafts/My%20list%20of%20Publish%20pluginsmonthly0.52020-05-03https://blog.bitomule.com/drafts/My%20omnifocus%20shortcuts%20for%20iOSmonthly0.52020-05-03 \ No newline at end of file diff --git a/Output/tags/blog/index.html b/Output/tags/blog/index.html index 622fea1..93ae53d 100644 --- a/Output/tags/blog/index.html +++ b/Output/tags/blog/index.html @@ -1 +1 @@ -Bitomule's learning shack

Getting started with publish

I just moved my blog to github pages using Publish and the first steps were consusing and difficult. John Sundell built an amazing tool, but a one man effort can't solve and document everything. I will write a series of posts about Publish trying to explain all the details to get a website up and running using Publish.

Moving blog again

I’ve moved my blog again after just a few months with a good reason.

\ No newline at end of file +Bitomule's learning shack

Moving blog again

I’ve moved my blog again after just a few months with a good reason.

\ No newline at end of file diff --git a/Output/tags/index.html b/Output/tags/index.html index 0d91fdf..3d7e3f2 100644 --- a/Output/tags/index.html +++ b/Output/tags/index.html @@ -1 +1 @@ -Bitomule's learning shack
\ No newline at end of file +Bitomule's learning shack
\ No newline at end of file diff --git a/Output/tags/publish/index.html b/Output/tags/publish/index.html index 622fea1..dcee58f 100644 --- a/Output/tags/publish/index.html +++ b/Output/tags/publish/index.html @@ -1 +1 @@ -Bitomule's learning shack

Getting started with publish

I just moved my blog to github pages using Publish and the first steps were consusing and difficult. John Sundell built an amazing tool, but a one man effort can't solve and document everything. I will write a series of posts about Publish trying to explain all the details to get a website up and running using Publish.

Moving blog again

I’ve moved my blog again after just a few months with a good reason.

\ No newline at end of file +Bitomule's learning shack

Automating deploy of your publish site to github pages

I have already shared how to get started with Publish. Today I’ll share how I’m automating the deploy process using Github Actions and how it enabled editing from my iPad.

Getting started with publish

I just moved my blog to github pages using Publish and the first steps were consusing and difficult. John Sundell built an amazing tool, but a one man effort can't solve and document everything. I will write a series of posts about Publish trying to explain all the details to get a website up and running using Publish.

Moving blog again

I’ve moved my blog again after just a few months with a good reason.

\ No newline at end of file diff --git a/Output/tags/web/index.html b/Output/tags/web/index.html index f548dcb..057796f 100644 --- a/Output/tags/web/index.html +++ b/Output/tags/web/index.html @@ -1 +1 @@ -Bitomule's learning shack

Tracking your site metrics without sacrificing​ user privacy

After having my blog up and running there was one piece missing, I didn't have any kind of tracking so it was impossible to know if people were reading me and what were they reading. Looks impossible, doesn't it?

Using portainer to manage container station

Today I want to share another experience with my NAS, in this case, I'll talk about how to replace container station with a better alternative called Portainer. As you may know, I've played with docker on my Qnap NAS. This has to lead me to hate container station software. It has too many limits and issues so as one of my experiments I wanted to find a replacement to it. The best replacement I've found is portainer and as always, when you know what you want the steps to do it are a lot easier.

Running a website from your Qnap NAS

The first proper post of the blog is something I don't do frequently: playing with the web. In this post, I'll explain how after some hours I got the blog running with a custom domain and SSL using docker in a qnap NAS. The process should work on any NAS (with Synology it could be even easier) but I'll explain it using the Qnap process.

\ No newline at end of file +Bitomule's learning shack

Automating deploy of your publish site to github pages

I have already shared how to get started with Publish. Today I’ll share how I’m automating the deploy process using Github Actions and how it enabled editing from my iPad.

Getting started with publish

I just moved my blog to github pages using Publish and the first steps were consusing and difficult. John Sundell built an amazing tool, but a one man effort can't solve and document everything. I will write a series of posts about Publish trying to explain all the details to get a website up and running using Publish.

Tracking your site metrics without sacrificing​ user privacy

After having my blog up and running there was one piece missing, I didn't have any kind of tracking so it was impossible to know if people were reading me and what were they reading. Looks impossible, doesn't it?

Using portainer to manage container station

Today I want to share another experience with my NAS, in this case, I'll talk about how to replace container station with a better alternative called Portainer. As you may know, I've played with docker on my Qnap NAS. This has to lead me to hate container station software. It has too many limits and issues so as one of my experiments I wanted to find a replacement to it. The best replacement I've found is portainer and as always, when you know what you want the steps to do it are a lot easier.

Running a website from your Qnap NAS

The first proper post of the blog is something I don't do frequently: playing with the web. In this post, I'll explain how after some hours I got the blog running with a custom domain and SSL using docker in a qnap NAS. The process should work on any NAS (with Synology it could be even easier) but I'll explain it using the Qnap process.

\ No newline at end of file