Posts about GitHub

Codespaces config for .NET Angular project

After creating a working dev container configuration for an ASP.NET Core with Angular project, I wanted to also try it out with GitHub Codespaces. I had to do additional changes to the configuration to get it working.

Update Docker images with Watchtower

June 30th 2023 Docker GitHub Synology

After I set up a self-hosted GitHub Actions runner on my Synology NAS, it only worked without issues until a new version of the image had been released. Since I couldn't get automatic updates working with my setup, I settled with a manual update process for the time being. When a reader suggested that I could use Watchtower instead, I decided to try it out when the next version of the runner is released.

Updating the self-hosted GitHub runner

June 2nd 2023 GitHub Docker Synology

After I set up a GitHub self-hosted runner on my Synology NAS, it worked great for a while. Then, on a random Saturday morning, I got an error notification. It turned out that the runner was trying to update itself, but it failed to restart at the end.

Using GitHub Copilot for CLI on Windows

May 26th 2023 GitHub PowerShell

GitHub Copilot for CLI is an NPM package which you can install and use on Windows if you have Node.js 16 or newer on your machine. However, the official setup only makes the commands available in zsh and bash. This means that you can only use it in WSL, but fortunately, there are also ways to make it work in PowerShell.

Migrating from Disqus to utterances

May 5th 2023 GitHub

I've been using Disqus as a comments engine on my blog since I switched to a statically generated site in 2015. Since then, I grew increasingly dissatisfied with it, primarily because of its unreliable notification system and complex administration panel. This post documents the steps I took to replace Disqus on my blog with utterances.

Restore file timestamps from Git

April 21st 2023 GitHub Git

Git doesn't restore file timestamps by default. So the file timestamp indicates when the file was cloned locally. And in most cases that's fine. But such a timestamp will prevent you from detecting if a file on a remote server has changed since it was last committed.

Run GitHub Actions on a Synology NAS

April 14th 2023 GitHub Docker Synology

Although GitHub-hosted runners should usually be your first choice for running GitHub Actions, you sometimes still might want to use a self-hosted runner to save on costs or work around IP blocking. If you own a Synology NAS, you can also use it to host a GitHub runner.

Using FTP in GitHub Actions

December 2nd 2022 GitHub

FTP is still one of the most common methods to upload files to your web server. So it's not surprising that there are (too) many GitHub actions for it. However, if you want to download some files (e.g. to backup/commit content that was edited online), you are mostly out of luck.

GitHub Actions and multi-project solutions

August 26th 2022 GitHub ASP.NET Core Azure

GitHub Actions can be a good choice for deploying an ASP.NET Core application to an Azure Web App Service if you have the code in a GitHub repository. You can even generate the GitHub Actions workflow directly from the Azure Portal. However, if your solution is not very simple, the generated workflow may not work correctly.

Using NuGet with packages.lock.json

When I was looking into GitHub Actions, I found an example configuration for dependency caching that seemed wrong to me. It specified that a unique key for caching dependencies should be generated by hashing all files named package.lock.json in the repository. I would expect the *.csproj files to be used instead.

Token permissions for GitHub Actions

May 6th 2022 GitHub

GitHub Actions provide a default GITHUB_TOKEN that can be used by steps in your workflow that require access to your GitHub repository. However, some actions require more permissions than others.

Blog post publishing with GitHub Actions

January 28th 2022 GitHub

For quite some time I have been regularly publishing new blog posts every Friday morning. I have the code for my blog in a GitHub repository. Each unpublished blog post that I have prepared in advance is in its own branch. To publish it, I just need to merge it with the main branch, which triggers the GitHub workflow I set up to deploy the blog. But while this does not take much time, I finally decided to look for ways to automate this last step.

Simplify common operations with GitHub CLI

October 8th 2021 GitHub

Most of my blog posts have an accompanying GitHub repository with sample source code. On average, I create one such new repository per week, and they all share most of their configuration options. I looked at several options for automating repository creation to speed it up and reduce the likelihood of misconfigurations due to human error. The option I liked best was GitHub CLI and its alias command.

Migrating from CircleCI to GitHub Actions

Since the introduction of GitHub Actions there's often no need any more to use an external CI/CD service. After I moved my blog repository from BitBucket to GitHub it was time to move my continuous deployment configuration from CircleCI to GitHub Actions as well.