GitHub Actions is a great tool for creating custom workflows for building, testing and deploying your code. They’re flexible and pretty easy to get started. According to the  documentation on creating custom actions, there are three supported ways to create custom actions:

  • Using JavaScript
  • Using a Dockerfile (or Docker image)
  • Composite Actions (multi-step builds that can also include shell scripts)

Typically if you want to write custom actions in Go, you have to use a Docker-based approach, but I was getting ready to write some actions to re-use elsewhere and started to wonder, “Could I use GopherJS to create the actions in Go instead?”

Image of the hello-gopherjs GitHub Action

You can find all of the code mentioned in this post in this repository:  steveyackey/hello-gopherjs

What is GopherJS?

GopherJS is a compiler that takes Go code and turns it into JavaScript that can be used in the browser. If you’d like to try it out, there are instructions in their GitHub repository:  https://github.com/gopherjs/gopherjs

#devops #github-actions #golang #go

Custom GitHub Actions in Go Without Docker
1.15 GEEK