name : Setup Hugo uses : with : hugo-version : '$ Where To Go From Here?Īs I said before, this article is supposed to give you a first impression of what GitHub Action can do for you with only a few lines of YAML. The action simplifies such decisions into a single step: Should you use the package provided by the OS, or download a specific version? Do I need Hugo Extended? Is curl or wget available? … In essence, GitHub Actions are tasks written running in Node.js with access to a lot of GitHub features.Īctions allow a workflow to concentrate what it’s supposed to do and not how to do it.įor example, setting up Hugo on a base Docker container would require downloading and installing the binary. Remember, GitHub Actions start from a simple Docker container with a base image, so you need to set up the environment, too:Īs GitHub Action can run arbitrary commands and scripts, you could create a shell script doing all these things and just run it.īut where’s the fun in that? GitHub Actions To design the pipeline requires you to establish the required steps first. A job has a series of steps that are either a pre-defined action, or you can run commands and shell scripts directly in the container. In the example, the name of the job is publish. jobs: One or more jobs that will run in Docker containers. You can check out all the possible events in the documentation. For this blog, however, only push is required. You’re not limited to Git events, though, as workflows can also run on events like “issue created” and others. The keys are quite self-explanatory, but let’s go over them: name: The name of your workflow on: One or more events that trigger your workflow. Name : Publish Blog on : push jobs : deploy : runs-on : ubuntu-22.04 steps :. Here’s the basic structure of GitHub Action workflow file: The actual filename doesn’t have much relevance, but let’s call it publish.yml. github of a repository in the subfolder workflows. Like some of the other GitHub features, e.g., PR and issue templates, workflows reside in the. The free-tier limits also apply to free accounts.įor all the details, check out the pricing page. If you want to run on another OS, like building an Xcode project on macOS, there are multipliers to be considered: Windows is 2x and macOS is 10x. How much storage and runtime minutes you get depends on the type of your GitHub account.įree accounts get 500MB of storage and can run action for up to 2.000 minutes. Such actions are combined into workflows with the help of YAML files, which are then run in Docker containers. In layman’s terms, it’s a way to run certain actions triggered by different events from a GitHub repository, like on push, pull requests, etc. GitHub describes them as “a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline.” Instead, it’s supposed to give you a taste of the action and encourage you to try out GitHub Actions yourself. This article won’t be an in-depth explanation or guide on how to use GitHub Actions. The general approach to how I deployed them didn’t change, though. When I was writing the previous post, I was still using Jekyll, which I replaced with Hugo in the meantime. To simplify my setup as much as possible, I revamp the process to use GitHub Actions with a private repository. The deployment process was based on Docker and a single Git hook, as I discussed in an earlier post. Almost three and a half years ago, I moved this blog from GitHub pages to my own little machine in the ether.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |