DevOps

[DevOps] gitHub Actions CICD - pipeline Example

차노도리 2023. 7. 1. 00:10

Github Action

  • GitHub에서 제공하는 지속적인 통합 (Continuous Integration) 및 지속적인 배포 (Continuous Deployment) 서비스

 

파이프 라인 만들기

  • .github/workflows 디렉토리에 저장된다.
  • name : 파이프 라인 이름 설정
  • on : 파이프라인이 동작할 event Trigger 설정
  • jobs: WorkFlow의 job 목록

ex) build.yml

# 파이프 라인 이름 설정
name: GUGBAB_GIT_FLOWER_CI

# Event Trigger 설정
on:
  push:
  pull_request:
  # Action 탭에서 Workflow실행 가능 설정
  workflow_dispatch:

# WorkFlow의 job 목록
jobs:
  build:
    # workflow가 실행될 환경
    runs-on: ubuntu-latest
    steps:
      - name: Set up Node.js environment
        uses: actions/setup-node@v3
        with:
          node-version: 18
          check-latest: true
          registry-url: https://registry.npmjs.org/
      - name: Run a one-line script
        run: echo Hello, world! git-flower PipeLine
      - name: Checkout repository
        uses: actions/checkout@v3              
      - name: Print current working directory
        run: |
          pwd
          ls
      - name: Perform a build
        run: |
          yarn install
          yarn build

 

actions 결과