1. 깃헙 액션이란?
GitHub Actions is a continuous integration and continuous delivery (CI/CD) platform that allows you to automate your build, test, and deployment pipeline. You can create workflows that build and test every pull request to your repository, or deploy merged pull requests to production.
공식 문서에서는 깃헙액션을 "빌드, 테스트, 배포 파이프라인을 자동화할수 있는 CI/CD 플랫폼" 이라고 소개하고 있다.
개인적으로는 Github을 쓰고 있다면 깃헙 액션을 쓰지 않을 이유가 없다고 느낄 정도이다. 인터넷에 레퍼런스만 복붙해도 쓸 수 있을 정도로 러닝 커브가 낮아 누구나 접근하기 쉽다.
깃헙에서 이루어지는 Push, Pull Request, Issue 생성 이벤트에 의해 Workflow가 트리거 될 수 있으며, 심지어 Scheduling도 가능해 스케줄러로 사용할 수도 있고, api로 트리거 될 수도 있다.
2. Workflow란?
Worflow는 yaml 파일로 정의되는 하나의 프로세스이다.
name: GitHub Actions Demo
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v3
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
jobs는 여러 step들이 모인 것을 말한다. step은 위부터 순서대로 실행되며 한 서버에서 실행되기 때문에 데이터 공유가 가능하다.
3. Runner란?
Runner는 Workflow가 실행되는 서버를 말한다. 여러 서버에서 병렬적으로 실행할 수 있다. 깃헙에서 제공하는 서버(Github-hosted Runners)와 사용자 서버(Self-hosted Runners)를 사용할 수 있다.
Github-hosted Runners에는 curl, git, npm, yarn, python, java, nodejs등 우리가 흔히 생각하는 툴들이 기본적으로 설치되어 있어서 웬만하면 모든 Workflow를 수행할 수 있지만, 마냥 불가능하다면 Self-hosted 서버를 사용해야한다.
반응형
'기타' 카테고리의 다른 글
[암호학] SHA-256은 안전하지 않다. (0) | 2024.02.14 |
---|---|
오른쪽 Command 키로 한영 변환하기 (0) | 2023.12.31 |
.git pre-commit 훅에서 커밋 메시지 가져오기 (0) | 2023.07.27 |
tailwindcss purge option 이슈 (0) | 2023.07.24 |
[Docker] 도커 이미지 디스크 초과 에러 (2) | 2022.02.17 |
댓글