Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/part1/issue-comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: issue-comment-workflow
on: issue_comment

jobs:
pr-comment:
if: ${{ github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: pr comment
run: echo ${{ github.event.issue.pull_request }}

issue-comment:
if: ${{ !github.event.issue.pull_request }}
runs-on: ubuntu-latest
steps:
- name: issue comment
run: echo ${{ github.event.issue.pull_request }}
15 changes: 15 additions & 0 deletions .github/workflows/part1/issue.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: issue-workflow
on:
issues:
types: [opened] # 이슈가 열렸을 때 동작함

jobs:
issue-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github action
36 changes: 36 additions & 0 deletions .github/workflows/part1/multiple_event.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: multiple-event-workflow
on:
push:
issues:
types: [opened] # 다시 공부해야하나
workflow_dispatch:
inputs:
name:
description: "set name"
required: true
default: "github-actions"
type: string
environment:
description: "set env"
required: true
default: "dev"
type: choice
options:
- dev
- qa
- prod

jobs:
multiple-event-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github action
- name: echo inputs
run: |
echo ${{ inputs.name }}
echo ${{ inputs.environment }}
37 changes: 37 additions & 0 deletions .github/workflows/part1/needs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 깃헙 액션 job 간에 종속성을 생성
# 하나의 job이 다른 job 또는 여러 job이 완료될 때 실행되도록 사용
# 즉 여러 job의 실행 순서를 조절
# 테스트 job이 실행되고, 그 job이 성공할 때 배포 job이 실행되도록 구성

name: needs
on: push

jobs:
job1:
runs-on: ubuntu-latest
steps:
- name: echo
run: echo "job1 done"

job2:
runs-on: ubuntu-latest
needs: [job1]
steps:
- name: echo
run: echo "job1 done"

job3:
runs-on: ubuntu-latest
steps:
- name: echo
run: |
echo "job3 failed"
exit 1

job4:
runs-on: ubuntu-latest
needs: [job3]
steps:
- name: echo
run: |
echo "job4 done"
15 changes: 15 additions & 0 deletions .github/workflows/part1/pull_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pull-request-workflow
on:
pull_request:
types: [opened]

jobs:
pull-request-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github actions
13 changes: 13 additions & 0 deletions .github/workflows/part1/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: push-workflow test test2
on: push # push 이벤트에 의해서 워크플로우를 트리거함

jobs:
push-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github actions
33 changes: 33 additions & 0 deletions .github/workflows/part1/workflow-dispatch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: workflow-dispatch
on:
workflow_dispatch:
inputs:
name:
description: "set name"
required: true
default: "github-actions"
type: string
environment:
description: "set env"
required: true
default: "dev"
type: choice
options:
- dev
- qa
- prod

jobs:
workflow-dispatch-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github action
- name: echo inputs
run: |
echo ${{ inputs.name }}
echo ${{ inputs.environment }}
11 changes: 11 additions & 0 deletions .github/workflows/part2/branch-filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: branch-filter
on:
push: # push 이벤트가
branches: ["dev"] # dev 에서 일어날 때 일어나는 워크플로우

jobs:
branch-filter:
runs-on: ubuntu-latest
steps:
- name: echo
run: echo hello
17 changes: 17 additions & 0 deletions .github/workflows/part2/checkout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: checkout
on: workflow_dispatch

jobs:
no-checkout:
runs-on: ubuntu-latest
steps:
- name: check file list
run: cat README.md

checkout:
runs-on: ubuntu-latest
steps:
- name: use checkout action
uses: actions/checkout@v4
- name: check file list
run: cat README.md
13 changes: 13 additions & 0 deletions .github/workflows/part2/context.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: context
on: workflow_dispatch

jobs:
context:
runs-on: ubuntu-latest
steps:
- name: github context
run: echo '${{ toJSON(github) }}' # 컨텍스트는 객체라 toJSON으로 변환할 수 있음
- name: check github context
run: |
echo ${{ github.repository }}
echo ${{ github.event_name }}
13 changes: 13 additions & 0 deletions .github/workflows/path-filter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: path-filter
on:
push:
paths:
- ".github/workflows/part1/*" # paths에 변경사항이 있을 경우에만 동작하는 이벤트
- "!.github/workflows/part1/push.yaml"

jobs:
path-filter:
runs-on: ubuntu-latest
steps:
- name: echo hello
run: echo hello