Post

02. CI & CD in practice

02. CI & CD in practice

Continuous Integration(CI) & Continuous Deployment(CD)


Prerequisites

1
1. Understand the step of CI/CD

In pratice

1. Add new option whether the github.io post have a the name of title or not?

After build site step, adding new option. In this case, for simple example and practice, i will add simple option whether the github post have a title or not.

2. Compare Before and After?

Before

The process is $ Build site \rightarrow Test site $.

So i wanna add new option “check in common”

Current state .

CICD-Before

After

Now i will add new option “check in common” between build site and Test site.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
      - name: Build site
      ...

      # new option
      - name: Check in common
        run: |
          echo "Check in common setting..."

          for file in _posts/*.md; do
            echo "Checking $file"

            if ! grep -q "^title:" "$file"; then
              echo "Missing title in $file"
              exit 1
            fi
          done

          echo "Check in common passed"

      - name: Test site
      ...

New state and processing

CICD-After1

Finish the new process

CICD-After2

Change the structure CI pipeline

CICD-Change

2. If the “check in common” step have issue from forgetting the title or wrong world

Intentionally Add typo within “title”

CICD-Wrong

CI process fails on “check in common” process and Fail to deploy

CICD-Error

After correct the name of title, it works

CICD-Pass

This post is licensed under CC BY 4.0 by the author.