๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ–ฅ๏ธ ๋ฐฑ์—”๋“œ/CICD6

[CICD] ๊ธฐ์ดˆ ์‹œ๋‚˜๋ฆฌ์˜ค ๊นƒํ—™ ์•ก์…˜ ๊นƒํ—™์•ก์…˜ ์ฝ”๋“œ ์˜ค๋ฅ˜ ๊ฒ€์‚ฌ ์‚ฌ์ดํŠธ https://rhysd.github.io/actionlint/ actionlint playground Loading WebAssembly binary... Yay! No error was detected. rhysd.github.io ๊ฐ•์˜ ์‹œ๋‚˜๋ฆฌ์˜ค 3 ํ˜„์žฌ ํ”„๋กœ์ ํŠธ์— ํˆฌ์žํ•  ์ˆ˜ ์žˆ๋Š” ์‹œ๊ฐ„์„ ๊ณ ๋ คํ•ด์„œ ์ผ๋‹จ ๊ฐ„๋‹จํ•œ CICD๋ฅผ ์ ์šฉํ•ด๋ณด๊ธฐ ์œ„ํ•ด ์‹œ๋‚˜๋ฆฌ์˜ค 3์„ ์„ ํƒํ•จ ๊ฐ€์ • ๊ฐœ๋ฐœํ™˜๊ฒฝ, QA, ์šด์˜ํ™˜๊ฒฝ์˜ CICD ๊ตฌ์„ฑ branch dev : ๊ฐœ๋ฐœํ™˜๊ฒฝ master : ์šด์˜ํ™˜๊ฒฝ QA ํ…Œ์ŠคํŠธ๋ฅผ ํ†ตํ•ด ์†Œํ”„๋ฅด์›จ์–ด ๊ฒฐํ•จ ์‹๋ณ„ํ•˜๊ธฐ ์ฝ”๋“œ์˜ ํ’ˆ์งˆ๊ณผ ๊ธฐ๋Šฅ์ด ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ๋™์ž‘ํ•˜๋Š”์ง€ ๊ฒ€์ฆํ•จ ๋ฐฐํฌ์ˆœ์„œ 1. ๊ฐœ๋ฐœ ํ™˜๊ฒฝ (dev branch) 2. QA ํ™˜๊ฒฝ 3. ์šด์˜ ํ™˜๊ฒฝ (master branch) ๊ธฐ์กด ์š”๊ตฌ.. 2024. 3. 23.
[CICD] ํ‚ค์›Œ๋“œ ๊ธฐ๋ฐ˜ ์ด์Šˆ ์•Œ๋ฆผ ์ž๋™ํ™” 3. ๊ฐ„๋‹จํ•œ ์›Œํฌํ”Œ๋กœ์šฐ ๋งŒ๋“ค๊ธฐ ํ‚ค์›Œ๋“œ ๊ธฐ๋ฐ˜ ์ด์Šˆ ์•Œ๋ฆผ ์ž๋™ํ™” ๋งŒ๋“ค๊ธฐ ์ด์Šˆ๊ฐ€ ์ƒ์„ฑ๋  ๋•Œ ์‹คํ–‰ issue event types: [opened] ํŠน์ • ํ‚ค์›Œ๋“œ๊ฐ€ ํฌํ•จ๋˜๋ฉด ์Šฌ๋ž™์œผ๋กœ ๊ณต์œ ํ•˜๊ธฐ if critical -> ์Šฌ๋ž™์˜ critical-issue ์ฑ„๋„๋กœ ๊ณต์œ  if cormal -> ์Šฌ๋ž™์˜ normal-issue ์ฑ„๋„๋กœ ๊ณต์œ  ํ‚ค์›Œ๋“œ๋Š” ๋ณ€๋™์‚ฌํ•ญ์ด ์ƒ๊ธธ ์ˆ˜ ์žˆ์Œ ๋ณต์žก์„ฑ์„ ์ค„์ด๋Š” ๋ฐฉ๋ฒ• ํ‚ค์›Œ๋“œ ๊ด€๋ฆฌํ•˜๊ธฐ (X) ๊นƒํ—™์•ก์…˜ ์›Œํฌํ”Œ๋กœ์šฐ์—์„œ ๊ด€๋ฆฌ (O) ์™ธ๋ถ€์—์„œ ํ‚ค์›Œ๋“œ ๊ด€๋ฆฌ ex) keyword.txt slack step ์‚ฌ์šฉ ๊ตฌ์กฐ ํ‚ค์›Œ๋“œ๋งŒํผ ์‚ฌ์šฉํ•˜๋ฉด ๊ด€๋ฆฌ๊ฐ€ ์–ด๋ ค์›€ slack step 1๊ฐœ๋กœ ์‚ฌ์šฉํ•˜๊ธฐ ๋™์ผํ•œ ์Šฌ๋ž™ ์›นํ›… ์ด๋ฆ„ ์‚ฌ์šฉํ•˜๊ธฐ ๋™์ผํ•œ ์‹œํฌ๋ฆฟ ์ด๋ฆ„ ์‚ฌ์šฉํ•˜๊ธฐ ${{ secret.SLACK_WEBHOOK }} ๊ตฌ์„ฑ job 2.. 2024. 3. 23.
[CICD] ๊นƒํ—™ ๋ ˆํฌ ์ƒ์„ฑ ์ž๋™ํ™” 3. ๊ฐ„๋‹จํ•œ ์›Œํฌํ”Œ๋กœ์šฐ ๋งŒ๋“ค๊ธฐ ๊นƒํ—› ๋ ˆํฌ ์ƒ์„ฑ ์ž๋™ํ™” name: create-repo 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 jobs: create-repo-automation: runs-on: ubuntu-latest steps: - name: gh auth login run: | echo ${{ secrets.PERSONAL_.. 2024. 3. 23.
[CICD] Github Actions์˜ ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ 2. Github Actions์˜ ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ 1. checkout github repository๋ฅผ ๊ฐ€์ ธ์™€์„œ ์ž‘์—…์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๋Š” ์•ก์…˜ ๋งˆ์ผ“ํ”Œ๋ ˆ์ด์Šค ๊ณต์‹ ์•ก์…˜ ํ•„์š”ํ•œ ํ…Œ์ŠคํŠธ๋‚˜ ๋นŒ๋“œ ์ž‘์—… ๋“ฑ์„ ์ˆ˜ํ–‰ํ•  ์ˆ˜ ์žˆ์Œ ๋ ˆํฌ์ง€ํ† ๋ฆฌ ๋‚ด์šฉ์„ CICD ์›Œํฌํ”Œ๋กœ์šฐ์—์„œ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Œ uses ํ‚ค์›Œ๋“œ๋กœ ์•ก์…˜์„ ๋ถˆ๋Ÿฌ์˜ฌ ์ˆ˜ ์žˆ์Œ 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@v.. 2024. 3. 22.
[CICD] Github Actions์˜ event Github Actions์˜ event 1. push ๋ ˆํŒŒ์ง€ํ† ๋ฆฌ / .github / workflows / push.yaml ํŒŒ์ผ ์ž‘์„ฑํ•˜๊ธฐ push.yaml name : ์•ก์…˜ ์ฐฝ์—์„œ ํ‘œํ˜„ ๋  ์‹œ๊ฐํ™” ์ด๋ฆ„ on : ์›Œํฌํ”Œ๋กœ์šฐ ํŠธ๋ฆฌ๊ฑฐ ํ•  ์ด๋ฒคํŠธ. ํŠธ๋ฆฌ๊ฑฐ ํƒ€์ž… jobs : ์‹คํ–‰์‹œํ‚ฌ job์˜ ์ง‘ํ•ฉ. ํ•„์ˆ˜ custom-job-name : job์ด๋ฆ„์€ ์ž์œ  runs on : job์„ ์‹คํ–‰์‹œํ‚ฌ runner ์ง€์ •ํ•˜๊ธฐ steps : step์˜ ์ง‘ํ•ฉ - name : job์ด ์‹คํ–‰์‹œํ‚ฌ ์Šคํƒญ ์ •์˜ํ•˜๊ธฐ. ์Šคํƒญ๋งˆ๋‹ค ์ด๋ฆ„์„ ๋ช…์‹œ์ ์œผ๋กœ ์ž‘์„ฑ/์ƒ๋žต ๊ฐ€๋Šฅ run : step์—์„œ ์‹คํ–‰ํ•  ๋‚ด์šฉ. |๋ฅผ ์ด์šฉํ•˜๋ฉด ๋ฉ€ํ‹ฐ๋ผ์ธ ์ปค๋งจ๋“œ ์ž‘์„ฑ ๊ฐ€๋Šฅ name: push-workflow on: push jobs: push-job: runs-on: ubun.. 2024. 3. 21.
[CICD] ๊นƒํ—ˆ๋ธŒ ์•ก์…˜ ์ปดํฌ๋„ŒํŠธ GitHub Action 2023๋…„ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋Š” CICD๋„๊ตฌ 1์œ„ GitHub์˜ ์ž๋™ํ™” ๋„๊ตฌ ๋‹จ์ˆœํ•œ ์›Œํฌํ”Œ๋กœ์šฐ ~ ๋ณต์žกํ•œ ์›Œํฌํ”Œ๋กœ์šฐ ๊ตฌ์ถ• ์†Œํ”„ํŠธ์›จ์–ด ๊ฐœ๋ฐœ ์›Œํฌํ”Œ๋กœ์šฐ ์ž๋™ํ™” GitHub ์ €์žฅ์†Œ ๋‚ด์—์„œ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์ง์ ‘ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์Œ YAML์„ ์ด์šฉํ•ด์„œ ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์‰ฝ๊ฒŒ ์„ค์ •ํ•  ์ˆ˜ ์žˆ์Œ ๋ฐ์ดํ„ฐ ๊ตฌ์กฐ๋ฅผ ๊ฐ„๋‹จํ•˜๊ฒŒ ํ‘œํ˜„ํ•œ ์ง๋ ฌํ™” ์–ธ์–ด .yml .yaml ํŠน์ง• ๋‹ค์–‘ํ•œ ์ด๋ฒคํŠธ(๊นƒํ—ˆ๋ธŒ ์ด๋ฒคํŠธ)์— ๋”ฐ๋ผ ์›Œํฌํ”Œ๋กœ์šฐ ์‹คํ–‰ ๊นƒํ—™์•ก์…˜ ์ปดํฌ๋„ŒํŠธ workflow ํ•˜๋‚˜ ์ด์ƒ์˜ ์ž‘์—…์„ ์‹คํ–‰ํ•˜๋Š”, ๊ตฌ์„ฑ ๊ฐ€๋Šฅํ•œ ์ž๋™ํ™” ํ”„๋กœ์„ธ์Šค .github/workflows ๊ฒฝ๋กœ์— ํŒŒ์ผ์ด ์žˆ์–ด์•ผ ์‹คํ–‰ ๊ฐ€๋Šฅํ•จ ์—ฌ๋Ÿฌ ์›Œํฌํ”Œ๋กœ์šฐ ์ƒ์„ฑ ๋ฐ ์‚ฌ์šฉ ๊ฐ€๋Šฅ ์ด๋ฒคํŠธ ๋ฐœ์ƒ์‹œ ์‹คํ–‰๋จ event ์›Œํฌํ”Œ๋กœ์šฐ ์‹คํ–‰์„ ํŠธ๋ฆฌ๊ฑฐํ•˜๋Š” ๊นƒํ—ˆ๋ธŒ ๋ ˆํฌ์ง€ํ† ๋ฆฌ ๋‚ด ํŠน์ • ํ™œ๋™ ํŠธ๋ฆฌ๊ฑฐ ๋ฐฉ์‹ :.. 2024. 3. 21.