How to build GitHub Actions in PHP with Minicli and Docker

Click for: original source

GitHub Actions facilitates creating CI/CD automated workflows that can be triggered by GitHub events, such as when a pull request is created, a merge is made, or a new comment is posted on an issue. What some people may not know is that you can also run GitHub actions at scheduled times, based on cron expressions. By Erika Heidi.

In this guide, you’ll learn how to use GitHub Actions to periodically run a PHP command line application built with Minicli. This application will update a CONTRIBUTORS file in the same repository where the workflow action is set, updating information about top contributors of a project. We’ll implement the repository update portion using the update-files-on-github action, which will generate a commit with the file change to the repository where the workflow is run.

This guide will help you with the following:

  • Bootstrapping the application
  • Pulling contributors with the GitHub API
  • Setting up the application Dockerfile
  • Creating the action file
  • Setting up a workflow

…and more. GitHub provides a large library of readily available actions you can integrate into your project, and you can also find user-contributed actions in the marketplace. However, because workflows are so flexible, sometimes it can be difficult to figure out how to combine multiple actions and which inputs or environment variables are required in certain scenarios. Nice one!

[Read More]

Tags cicd containers devops php apis app-development