구체적인 내용은 뒤에 언급하도록 하고, 실습으로 들어가겠습니다. 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도 제공하고 있습니다.
처음으로 테스트해볼 코드입니다. 모두 지우시고 아래 코드를 입력해주세요.