Member-only story

GitOps — Github Actions Workflow Introduction

GitOps using Github Actions

Tony
5 min readApr 6, 2023

What is Github Actions Workflow

In Github Actions, workflows are automated and configurable processes that you can add to your GitHub repository, they are core functionality of Github Actions.

Workflows consist of one or multiple jobs that are triggered by specific events. A workflow configuration is defined in a workflow file, which must be written using YAML.

You can define multiple workflows, each performing a different set of actions. For example, one workflow can specify how to create and test a pull request, while another workflow can automatically deploy an application when a new release is created. However, all workflow files for Github Actions must be stored in .github/workflows directory.

An example workflow YAML file looks like:

name: Docker Image CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build the Docker image
run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)

The above workflow tells Github Action to build a Docker image from a given Dockerfile.

--

--

Tony
Tony

Responses (1)