๊ตฌ์ฒด์ ์ธ ๋ด์ฉ์ ๋ค์ ์ธ๊ธํ๋๋ก ํ๊ณ , ์ค์ต์ผ๋ก ๋ค์ด๊ฐ๊ฒ ์ต๋๋ค. github์ ๋ก๊ทธ์ธ ํ ํ Start a Project๋ฅผ ๋๋ฌ์ฃผ์ธ์.

ย
repo๋ฅผ ์๋ก ๋ง๋ค๋๋ก ํ๊ฒ ์ต๋๋ค.
Add a README file
์ ์ ํํด์ฃผ์ธ์.
ย
Action ํญ์ ์ ํํ๊ณ
set up a workflow yourself
๋ฅผ ํด๋ฆญํด์ฃผ์ธ์. ํ๋จ์ ๋ค๋ฅธ workflow๋ฅผ ์ ํํ ์ ์์ง๋ง ์ด๋ฒ ์๊ฐ์๋ ๊ฐ์ฅ ๊ธฐ๋ณธ์ ์ธ ํ
ํ๋ฆฟ์ผ๋ก ์์ํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.ย

ย
์๋ ์ฃผ์ด์ง๋ ์ฝ๋๊ฐ ๊ธฐ๋ณธ ์ฝ๋์
๋๋ค.

ย
๊ธฐ๋ณธ ํ
ํ๋ฆฟ ์ฝ๋์
๋๋ค. ์ฃผ์์ ๋ค์์ ํ๋์ฉ ์ค๋ช
์ ํด๋๋ฆด ์์ ์
๋๋ค.
# 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๋ ์ ๊ณตํ๊ณ ์์ต๋๋ค.

ย
์ฒ์์ผ๋ก ํ
์คํธํด๋ณผ ์ฝ๋์
๋๋ค. ๋ชจ๋ ์ง์ฐ์๊ณ ์๋ ์ฝ๋๋ฅผ ์
๋ ฅํด์ฃผ์ธ์.
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 ํ ์๋ ์์ง๋ง, ์ฐ๋ฆฌ๋ ๊ฐ๋ฅํ๋ฉด ์น ์์์ ๋ชจ๋ ํด๊ฒฐํ๋๋ก ํ๊ฒ ์ต๋๋ค.

ย
ย
ํ์ผ ์์ฑ์ด ์๋ฃ๋์์ต๋๋ค.

ย
์ต์์ ํด๋๋ก ๋ค์ด์
Create new file
์ ํด๋ฆญํด์ฃผ์ธ์.ย

ย
test.py
๋ผ๋ ํ์ผ์ ํ๋ ์์ฑํ๋๋ก ํ๊ฒ ์ต๋๋ค.
ย
ย
์๋๋ก ์คํฌ๋กค์ ๋ด๋ฆฌ์
์ commit ํด์ฃผ์ธ์.
ย

ย
Actions
ํญ์ผ๋ก ๋ค์ด๊ฐ์๋ฉด ์ฃผํฉ์ํ์๊ฐ ๊ณง ์๋์ฒ๋ผ ์ด๋ก์ ์ฒดํฌ๋ก ๋ฐ๋๋ฉด์ ๋ชจ๋ Action์ด ๋ค ๋์๊ฐ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค. hello github action test1
์ ํด๋ฆญํด์ฃผ์ธ์. ์ฌ๋ฌ๋ถ์ด ๋ง๋์ ํ์ผ์ commit title์ ๋ฐ๋ผ ์ด ์ด๋ฆ์ด ๋ฐ๋ ์ ์์ต๋๋ค. ย


ย
๋น๋๋ฅผ ํด๋ฆญํด์ฃผ์ธ์.

ย
ย
์ฐ๋ฆฌ๊ฐ ์ ์ด๋์ job์ด ์์๋๋ก ์คํ๋ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค.

ย
๋ชจ๋ build๋ฅผ ํ์ธํด๋ด
์๋ค.
ย

ย
ย
๋ค์ ์ฝ๋๋ก ๋์์ Python ์คํ๋ด
์๋ค. ํฌ ๋ฒํผ์ ํด๋ฆญํด์ ์์ ํด์ฃผ์ธ์.
ย

ย
ย
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์ ํด์ฃผ์ธ์.

ย
์ ๋ฌ๊ฐ ๋ ๊ฒ์ ์ ์ ์์ต๋๋ค. ํด๋น ํ์ผ์ Actions์์ ๋ชป์ฐพ๊ณ ์๋ ๊ฒ์ธ๋ฐ์.

ย
์๋์ ๊ฐ์ด 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๋ฅผ ์ทจ์ํ๋ ๊ฒ๋ ๊ฐ๋ฅํฉ๋๋ค.

ย