๐Ÿ“

1. hello github action

๊ตฌ์ฒด์ ์ธ ๋‚ด์šฉ์€ ๋’ค์— ์–ธ๊ธ‰ํ•˜๋„๋ก ํ•˜๊ณ , ์‹ค์Šต์œผ๋กœ ๋“ค์–ด๊ฐ€๊ฒ ์Šต๋‹ˆ๋‹ค. github์— ๋กœ๊ทธ์ธ ํ•œ ํ›„ Start a Project๋ฅผ ๋ˆŒ๋Ÿฌ์ฃผ์„ธ์š”.
notion imagenotion image
ย 
repo๋ฅผ ์ƒˆ๋กœ ๋งŒ๋“ค๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. Add a README file์€ ์„ ํƒํ•ด์ฃผ์„ธ์š”.
notion imagenotion image
ย 
Action ํƒญ์„ ์„ ํƒํ•˜๊ณ  set up a workflow yourself๋ฅผ ํด๋ฆญํ•ด์ฃผ์„ธ์š”. ํ•˜๋‹จ์— ๋‹ค๋ฅธ workflow๋ฅผ ์„ ํƒํ•  ์ˆ˜ ์žˆ์ง€๋งŒ ์ด๋ฒˆ ์‹œ๊ฐ„์—๋Š” ๊ฐ€์žฅ ๊ธฐ๋ณธ์ ์ธ ํ…œํ”Œ๋ฆฟ์œผ๋กœ ์‹œ์ž‘ํ•ด๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
ย 
notion imagenotion image
ย 
์•„๋ž˜ ์ฃผ์–ด์ง€๋Š” ์ฝ”๋“œ๊ฐ€ ๊ธฐ๋ณธ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค.
notion imagenotion image
ย 
๊ธฐ๋ณธ ํ…œํ”Œ๋ฆฟ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค. ์ฃผ์„์€ ๋’ค์—์„œ ํ•˜๋‚˜์”ฉ ์„ค๋ช…์„ ํ•ด๋“œ๋ฆด ์˜ˆ์ •์ž…๋‹ˆ๋‹ค.
# This is a basic workflow to help you get started with Actions name: CI # Controls when the action will run. on: # Triggers the workflow on push or pull request events but only for the main branch push: branches: [ main ] pull_request: branches: [ main ] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: # This workflow contains a single job called "build" build: # ์‹คํ–‰๋˜๋Š” OS, Window์™€ Mac OS๋„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. runs-on: ubuntu-latest # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 # Runs a single command using the runners shell - name: Run a one-line script run: echo Hello, world! # Runs a set of commands using the runners shell - name: Run a multi-line script run: | echo Add other actions to build, echo test, and deploy your project.
ย 
์šฐ์ธก์— ๋ณด๋ฉด Document๋„ ์ œ๊ณตํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค.
notion imagenotion image
ย 
์ฒ˜์Œ์œผ๋กœ ํ…Œ์ŠคํŠธํ•ด๋ณผ ์ฝ”๋“œ์ž…๋‹ˆ๋‹ค. ๋ชจ๋‘ ์ง€์šฐ์‹œ๊ณ  ์•„๋ž˜ ์ฝ”๋“œ๋ฅผ ์ž…๋ ฅํ•ด์ฃผ์„ธ์š”.
name: helloGithubAction on: [push] jobs: build: runs-on: ubuntu-latest steps: # run ๋’ค์—๋Š” ์‹ค์ œ ์ž‘๋™ํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ๋„ฃ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. - name: hello world ์ถœ๋ ฅ!! run: echo Hello, world! - name: ๋””๋ ‰ํ† ๋ฆฌ ์ถœ๋ ฅ!! run: ls -al - name: ํŒŒ์ด์ฌ ๋ฒ„์ „ ์ถœ๋ ฅ!! run: python -V
ย 
๊ทธ๋Œ€๋กœ commitํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ๋กœ์ปฌ์—์„œ CLI ์ฐฝ์—์„œ pull๋ฐ›์•„ push ํ•  ์ˆ˜๋„ ์žˆ์ง€๋งŒ, ์šฐ๋ฆฌ๋Š” ๊ฐ€๋Šฅํ•˜๋ฉด ์›น ์ƒ์—์„œ ๋ชจ๋‘ ํ•ด๊ฒฐํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
notion imagenotion image
ย 
ย 
ํŒŒ์ผ ์ƒ์„ฑ์ด ์™„๋ฃŒ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.
notion imagenotion image
ย 
์ตœ์ƒ์œ„ ํด๋”๋กœ ๋“ค์–ด์™€ Create new file์„ ํด๋ฆญํ•ด์ฃผ์„ธ์š”.
ย 
notion imagenotion image
ย 
test.py๋ผ๋Š” ํŒŒ์ผ์„ ํ•˜๋‚˜ ์ƒ์„ฑํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
notion imagenotion image
ย 
ย 
์•„๋ž˜๋กœ ์Šคํฌ๋กค์„ ๋‚ด๋ฆฌ์…”์„œ commit ํ•ด์ฃผ์„ธ์š”.
ย 
notion imagenotion image
ย 
Actions ํƒญ์œผ๋กœ ๋“ค์–ด๊ฐ€์‹œ๋ฉด ์ฃผํ™ฉ์ƒ‰ํ‘œ์‹œ๊ฐ€ ๊ณง ์•„๋ž˜์ฒ˜๋Ÿผ ์ดˆ๋ก์ƒ‰ ์ฒดํฌ๋กœ ๋ฐ”๋€Œ๋ฉด์„œ ๋ชจ๋“  Action์ด ๋‹ค ๋Œ์•„๊ฐ„ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. hello github action test1 ์„ ํด๋ฆญํ•ด์ฃผ์„ธ์š”. ์—ฌ๋Ÿฌ๋ถ„์ด ๋งŒ๋“œ์‹  ํŒŒ์ผ์˜ commit title์— ๋”ฐ๋ผ ์ด ์ด๋ฆ„์ด ๋ฐ”๋€” ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
ย 
notion imagenotion image
notion imagenotion image
ย 
๋นŒ๋“œ๋ฅผ ํด๋ฆญํ•ด์ฃผ์„ธ์š”.
notion imagenotion image
ย 
ย 
์šฐ๋ฆฌ๊ฐ€ ์ ์–ด๋†“์€ job์ด ์ˆœ์„œ๋Œ€๋กœ ์‹คํ–‰๋œ ๊ฒƒ์„ ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
notion imagenotion image
ย 
๋ชจ๋“  build๋ฅผ ํ™•์ธํ•ด๋ด…์‹œ๋‹ค.
ย 
notion imagenotion image
ย 
ย 
๋‹ค์‹œ ์ฝ”๋“œ๋กœ ๋Œ์•„์™€ Python ์‹คํ–‰๋ด…์‹œ๋‹ค. ํŒฌ ๋ฒ„ํŠผ์„ ํด๋ฆญํ•ด์„œ ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”.
ย 
notion imagenotion image
ย 
ย 
name: helloGithubAction on: [push] jobs: build: runs-on: ubuntu-latest steps: # run ๋’ค์—๋Š” ์‹ค์ œ ์ž‘๋™ํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ๋„ฃ์–ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. - name: hello world ์ถœ๋ ฅ!! run: echo Hello, world! - name: ๋””๋ ‰ํ† ๋ฆฌ ์ถœ๋ ฅ!! run: ls -al - name: ํŒŒ์ด์ฌ ๋ฒ„์ „ ์ถœ๋ ฅ!! run: python -V - name: ํŒŒ์ด์ฌ ํŒŒ์ผ ์‹คํ–‰!! run: python 'test.py'
ย 
commit์„ ํ•ด์ฃผ์„ธ์š”.
notion imagenotion image
ย 
์• ๋Ÿฌ๊ฐ€ ๋‚œ ๊ฒƒ์„ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ•ด๋‹น ํŒŒ์ผ์„ Actions์—์„œ ๋ชป์ฐพ๊ณ  ์žˆ๋Š” ๊ฒƒ์ธ๋ฐ์š”.
notion imagenotion image
ย 
์•„๋ž˜์™€ ๊ฐ™์ด uses ์ฝ”๋“œ๋ฅผ ์‚ฝ์ž…ํ•ด์ฃผ์‹œ๋ฉด ์ •์ƒ์ ์œผ๋กœ ์‹คํ–‰์ด ๋ฉ๋‹ˆ๋‹ค.
name: helloGithubAction on: [push] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Run Python run: python test.py
ย 
hello world๊ฐ€ ์ถœ๋ ฅ๋˜์…จ๋‚˜์š”? ์ด์ œ ๋ณธ๊ฒฉ์ ์œผ๋กœ github actions๋ฅผ ๋‹ค๋ค„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
  • ์‹คํ–‰์‹œ๊ฐ„์ด ๋„ˆ๋ฌด ๊ธด ํŒŒ์ผ์„ ์‹คํ–‰ํ–ˆ๋‹ค๋ฉด ์•„๋ž˜์ฒ˜๋Ÿผ ํ•ด๋‹น jobs๋ฅผ ์ทจ์†Œํ•˜๋Š” ๊ฒƒ๋„ ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค.
    • notion imagenotion image
ย