GitHub Actions: Now CI/CD baked-in
Photo by Fervent Jan on Unsplash

GitHub Actions: Now CI/CD baked-in

Earlier this year, GitHub Actions was released which is a platform for developer workflow orchestration and automation. While Actions already has been popular, a recent announcement might mean a game-changer for CI/CD landscape. The announcement says that GitHub Actions will be supporting CI/CD - right from your source code repository! In this article, I share my experience of using GitHub Actions in beta.

Let's start with the cool features:

  • Any OS/Language/Platform: You can build, test, and deploy your projects on any platform, including Linux, macOS, Windows, in a container or in a virtual machine. Actions also supports Node.js, Python, Java, PHP, Ruby, C/C++, .NET, Android, and iOS. For the demo provided, I'm using Node.js/Ubuntu combination.
  • Multi-container testing: You can test your web service and its database together by simply adding some docker-compose to your workflow file. I haven't tried out this feature but it is a powerful option for real projects where you'd need to simultaneously test multiple containers.
  • Matrix builds: This feature allows you to test multiple versions of your project, in parallel. Check-out the following code-snippet which runs tests on multiple versions of node as well as OS (Code source: here):
jobs:
  test:
    name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        node_version: [8, 10, 12]
        os: [ubuntu-latest, windows-latest, macos-latest]

    steps:
    - uses: actions/checkout@v1

    - name: Use Node.js ${{ matrix.node_version }}
      uses: actions/setup-node@v1
      with:
        version: ${{ matrix.node_version }}

    - name: npm install, build and test
      run: |
        npm install
        npm run build --if-present
        npm test
  • Live logs: Live logs provide rich feedback into the progress of your builds as they run. GitHub streams your logs to the Actions console to show your status in real time. A sample run of my CI build process with live logs is shown near the end of this article.

Enough theory! Let's try it out by creating a CI build process which will build the image from your source code and push it to an image registry (need beta access if you're trying before Nov13). Step-by-step instructions are provided on my GitHub repo (a sample run shown in the image below). Don't worry if you do not have beta access to GitHub Actions; its GA-ing on Nov.13 and will be free for public repositories.

No alt text provided for this image




要查看或添加评论,请登录

Dewan A.的更多文章

  • Migration Best Practices: Moving Code, Pipelines & Tools Between Platforms

    Migration Best Practices: Moving Code, Pipelines & Tools Between Platforms

    So, you’re switching platforms—whether it's GitHub to Harness, GitLab to GitHub, or something else entirely. Moving…

  • Hosting a (DevOpsDays) Tech Conference

    Hosting a (DevOpsDays) Tech Conference

    In August 2024, we pulled off the first-ever DevOpsDays Halifax, and wow, what an experience! As one of the organizers,…

    1 条评论
  • Need for Automation - GitOps at Scale

    Need for Automation - GitOps at Scale

    Building a skyscraper is a lot like building software. Initially, you might experiment with materials on a different…

  • Deploying to Kubernetes with Gitness

    Deploying to Kubernetes with Gitness

    Gitness is an open-source Git solution designed with developers in mind. At its core, it offers a reliable space to…

  • Kubernetes and OpenShift Workshop

    Kubernetes and OpenShift Workshop

    This marks my final article on OpenShift4.X series of articles which I started writing in December 2019.

    1 条评论
  • OpenShift 4.X Operators - Installing and playing with AMQ Streams operator

    OpenShift 4.X Operators - Installing and playing with AMQ Streams operator

    Red Hat AMQ Streams is a massively scalable, distributed, and high-performance data streaming platform based on the…

    1 条评论
  • Why (and how) you should be blogging NOW?

    Why (and how) you should be blogging NOW?

    At the time of writing this article, most of the major cities are in a lock-down due to the global COVID-19 pandemic…

    2 条评论
  • OpenShift 4.X Operators - Kubernetes API Fundamentals

    OpenShift 4.X Operators - Kubernetes API Fundamentals

    For the next few weeks, starting this week, I'll be writing about Operators - software to install Kubernetes…

    1 条评论
  • OpenShift 4.X Service Mesh - Istio

    OpenShift 4.X Service Mesh - Istio

    The more we embrace cloud adaption, the greater the push to break down applications into microservices. Istio, by using…

    5 条评论
  • OpenShift 4.X CI/CD - OpenShift Pipelines

    OpenShift 4.X CI/CD - OpenShift Pipelines

    OpenShift Pipelines is a cloud-native CI/CD solution for building pipelines that is based on open-source project…

    3 条评论

社区洞察

其他会员也浏览了