github actions

First Simple Workflow

wefree 2022. 2. 13. 14:44

workflow 파일 생성

./github/workflows/simple.yml 

git clone https://github.com/windbird123/github-actions-test.git
vi github-actions-test/.github/workflows/simple.yml
name: Shell Commands

on:
  - push

jobs:
  run-shell-command:
    runs-on: ubuntu-latest
    steps:
      - name: echo a string
        run: echo "Hello World"
      - name: multiline script
        run: |
          node -v
          npm -v

 

코드 PUSH

source code 뿐만 아니라 위의 simple.yml 파일을 PUSH 하게되면 github actions 가 실행된다.

 

 

Notification 설정하기

github actions 수행 결과를 메일 등으로 수신받고 싶을 경우 https://github.com/settings/profile 에서 설정한다.

 

 

DEBUG 정보 설정하기

workflow 가 실패해 상세한 DEBUG 정보를 보고 싶을 때는 Enabling debug logging 가이드에 나온 것 처럼  ACTIONS_RUNNER_DEBUG, ACTIONS_STEP_DEBUG 값을 true 로 Actions Secret 항목에 설정한다.

 

DEBUG 설정 후 아래처럼 자세한 메시지를 볼 수 있다.

 

참고: https://www.udemy.com/course/github-actions