Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
b563f19
das
milkiss0404 Aug 5, 2024
acd7b1e
sibbal
milkiss0404 Aug 5, 2024
de6d302
lucky
milkiss0404 Aug 5, 2024
a9bb8c6
pull request job
milkiss0404 Aug 5, 2024
44d83b2
add issue.yaml
milkiss0404 Aug 5, 2024
427c737
reset
milkiss0404 Aug 6, 2024
472fe1f
add pull_request.yaml
milkiss0404 Aug 6, 2024
0ed351c
add pull_request.yaml
milkiss0404 Aug 6, 2024
daf5e06
add issue.yaml
milkiss0404 Aug 6, 2024
7170e69
add issue_comment.yaml
milkiss0404 Aug 6, 2024
cff101e
add workflow_dispatch
milkiss0404 Aug 6, 2024
be004ce
add workflow_dispatch
milkiss0404 Aug 6, 2024
e6fa516
add multiple event
milkiss0404 Aug 6, 2024
0396416
add need.yaml
milkiss0404 Aug 6, 2024
4891586
checkout.yaml
milkiss0404 Aug 6, 2024
88e95c5
checkout.yaml
milkiss0404 Aug 6, 2024
04925f8
checkout.yaml
milkiss0404 Aug 6, 2024
07ce63d
add context.yaml
milkiss0404 Aug 6, 2024
5873ff6
add context.yaml
milkiss0404 Aug 6, 2024
b3079ba
add branchfilter.yaml
milkiss0404 Aug 6, 2024
56496d0
add branchfilter.yaml
milkiss0404 Aug 6, 2024
670aac8
add pathfilter.yaml
milkiss0404 Aug 6, 2024
e50591f
add pathfilter.yaml
milkiss0404 Aug 6, 2024
44c4b6b
update part1
milkiss0404 Aug 6, 2024
92afc86
update workflow
milkiss0404 Aug 6, 2024
6f9666c
add tag_filter.yaml
milkiss0404 Aug 6, 2024
1c848ab
fix
milkiss0404 Aug 6, 2024
d139a1f
fix
milkiss0404 Aug 6, 2024
9754726
ddd
milkiss0404 Aug 8, 2024
83a68f7
add artifact.yaml
milkiss0404 Aug 8, 2024
5f7e1bd
add artifact.yaml
milkiss0404 Aug 8, 2024
b61133f
add var-1
milkiss0404 Aug 8, 2024
3108453
add var-1
milkiss0404 Aug 8, 2024
bc47027
add var-2
milkiss0404 Aug 8, 2024
ac99817
environment.yaml
milkiss0404 Aug 8, 2024
5696d83
create_repo.yaml
milkiss0404 Aug 8, 2024
505e371
create_repo.yaml
milkiss0404 Aug 8, 2024
611d761
create_repo.yaml
milkiss0404 Aug 8, 2024
294ddf8
add issue_notify.yaml
milkiss0404 Aug 9, 2024
7574a87
add issue_notify.yaml
milkiss0404 Aug 9, 2024
203af33
add cicd-1.yaml
milkiss0404 Aug 9, 2024
3fd53f3
Update App.js
milkiss0404 Aug 9, 2024
2e1adfa
Merge pull request #9 from woochul-action/feature-cicd1
milkiss0404 Aug 9, 2024
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
29 changes: 29 additions & 0 deletions .github/workflows/cicd-1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: cicd-1
on:
pull_request:
types: [opened, synchronize, closed]
branches: [dev]
paths:
- 'my-app/**'

jobs:
test:
if: github.event.action == 'opened' || github.event.action == 'synchronize'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

image-build:
if: github.event.pull_request.merged == true #merge단계에서 실행되는 잡 , 즉 cd단계
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4

deploy:
runs-on: ubuntu-latest
needs: [image-build]
steps:
- name: checkout
uses: actions/checkout@v4
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
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 }}
18 changes: 18 additions & 0 deletions .github/workflows/part1/multiple_event.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: multiple-event-workflow
on:
push:
issues:
types: [opened]
workflow_dispatch:


jobs:
multiple-event-job:
runs-on: ubuntu-latest
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github action
29 changes: 29 additions & 0 deletions .github/workflows/part1/needs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
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 "job2 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 action
16 changes: 16 additions & 0 deletions .github/workflows/part1/push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: push-workflow
# 이벤트
on: push

# 푸시할 잡의 집합
jobs:
# push-job이라는 이름의 job
push-job:
runs-on: ubuntu-latest2222
steps:
- name: step1
run: echo hello world
- name: step2
run: |
echo hello world
echo github action
34 changes: 34 additions & 0 deletions .github/workflows/part1/workflow_dispatch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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 }}
25 changes: 25 additions & 0 deletions .github/workflows/part2/artifact.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: artifact
on: push

jobs:
upload-artifact:
runs-on: ubuntu-latest
steps:
- name: echo
run: echo hello-world > hello.txt #텍스트 파일안에 문자열이들어가게
- name: upload-artifact
uses: actions/upload-artifact@v3 #아티팩트 업로드
with:
name: artifact-test #아티팩트이름
path: ./hello.txt #아티팩트할 파일의 경로
download-artifact:
runs-on: ubuntu-latest
needs: [upload-artifact]
steps:
- name: download-artifact
uses: actions/download-artifact@v3
with:
name: artifact-test
path: ./
- name: check
run: cat hello.txt
11 changes: 11 additions & 0 deletions .github/workflows/part2/branchfilter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: branch-filter
on:
push:
branches: ["dev-test"]

jobs:
branch-filter:
runs-on: ubuntu-latest
steps:
- name: echo
run: echo hello
31 changes: 31 additions & 0 deletions .github/workflows/part2/cache.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: cache
on:
push:
paths:
- 'my-app/**' #별표 두개는 myapp 아래모든걸 포함한다는의미

jobs:
cache:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4 #체크아웃 하기위한 액션
- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache Node.js modules
uses: actions/cache@v3
with: #with를 사용해서 path,key,restore-key 를 input값으로 전달한다
path: ~/.npm #캐싱할 경로
key: ${{ runner.os }}-node-
restore-keys: |
${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
- name : Install dependencies
run: |
cd my-app
npm ci
- name: npm build
run: |
cd my-app
npm run build
18 changes: 18 additions & 0 deletions .github/workflows/part2/checkout.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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) }}'
- name: check github context
run: |
echo ${{ github.repository}}
echo ${{ github.event_name}}
29 changes: 29 additions & 0 deletions .github/workflows/part2/create_repo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: create-output
on:
workflow_dispatch:
inputs:
prefix:
description: 'set repo prefix'
required: true
default: 'service'
type: choice
options:
- example
- service
name:
description: 'set repo name'
required: true
default: 'github-actions'
type: string
#gh auth login --with-token 깃헙권한 사용가능하게
jobs:
create-repo-automation:
runs-on: ubuntu-latest
steps:
- name: gh auth login
run: |
echo ${{ secrets.PERSONAL_ACCESS_TOKEN }} | gh auth login --with-token
- name: create-repo
run: |
gh repo create woochul-action/${{ inputs.prefix }}-${{ inputs.name }} --public --add-readme

11 changes: 11 additions & 0 deletions .github/workflows/part2/environment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: environment
on: push

jobs:
get-env:
runs-on: ubuntu-latest
steps:
- name: cheeck env & secret
run: |
echo ${{ vars.level }}
echo ${{ secrets.key }}
28 changes: 28 additions & 0 deletions .github/workflows/part2/issue_notify.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: issue-notify
on:
issues:
types: [opened]

jobs:
get-keyword:
runs-on: ubuntu-latest
outputs:
level: ${{ steps.get-keyword.outputs.level }}
steps:
- name: checkout
uses: actions/checkout@v4 #checkout 액션을 사용하면 github repo코드를 github job으로 가져올수있음
- name: get keyword
id: get-keyword
run: |
echo level=Undefined >> $GITHUB_OUTPUT

keywords=$(cat keyword-list.txt)
for keyword in $keywords; do
if [[ "${{ github.event.issue.title }}" =~ "$keyword" ]]; then
echo level=$keyword >> $GITHUB_OUTPUT

fi
done
- name: get output
run: |
echo ${{ steps.get-keyword.outputs.level }}
23 changes: 23 additions & 0 deletions .github/workflows/part2/output.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: output
on: push

jobs:
create-output:
runs-on: ubuntu-latest
outputs:
test: ${{ steps:check-out.outputs.test }}
steps:
- name: echo output
id: chec-output
run: |
echo "test=hello" >> $GITHUB_OUTPUT
- name: check output
run: |
echo ${{ steps.check-output.outputs.test }}

get-output:
needs: [create-output]
runs-on: ubuntu-latest
steps:
- name: get output
run: echo ${{ needs.create-output.outputs.test }}
Loading