- ๊ฐ๋ฐ๊ณผ์ ์์ ๋ฐ์ํ๋ ์ํฌํ๋ก์ฐ๋ฅผ ์๋ํํ ์ ์๋ ๋๊ตฌ
- ๋น๋ / ํ
์คํธ / ์ปค๋ฒ๋ฆฌ์ง / ๋ฐฐํฌ๊น์ง ์งํํ ์ ์๋ค.
How to use?
.github/workflows
์๋์ action์ด ์์ฑ๋ yml ํ์ผ์ ์ถ๊ฐํ๋ฉด ๋๋ค.
Github์ Tab์ Action์ผ๋ก ํ์ธํ ์ ์๋ค.

๋ค์ํ ์์ ๊ฐ ์์ด ์ฐธ๊ณ ํ๊ธฐ ์ข๋ค.

on:
# Push ๋ ๋๋ง๋ค ๋๊ธฐ
push:
branches:
- master
- release/*
# PR ์กฐ๊ฑด ๊ฑธ๊ธฐ
pull_request:
branches:
- master
# ์ค์ผธ์ค๋ง๋ ๊ฐ๋ฅ
schedule:
- cron: "0 2 * * 1-5"
Virtual environment | YAML workflow label |
---|
Windows Server 2019 | windows-latest |
Ubuntu 18.04 | ubuntu-latest or ubuntu-18.04 |
Ubuntu 16.04 | ubuntu-16.04 |
macOS Catalina 10.15 | macos-latest |
jobs:
my_job:
name: deploy to staging
runs-on: ubuntu-18.04
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: '10.x'
๋ณ์ ํ๋ ฌํํ์ฌ ์ฌ์ฉ ๊ฐ๋ฅํ๋ค.
jobs:
test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: ['8', '10', '12']
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: npm install, build and test
run: |
npm install
npm run build --if-present
npm test
Settings - Secret
์ ๋ฑ๋กํ์ฌ ์ฌ์ฉํ๋ฉด ๋๋ค.

coverage:
name: 'Coverage'
needs: linux
steps:
- name: Upload to Codecov.io
shell: bash
env:
CODECOV_TOKEN: # ${{secrets.CODECOV_TOKEN}}๋ก ์ฌ์ฉํ๋ฉด ๋๋ค
run: |
bash <(curl -s https://codecov.io/bash)
https://github.com/<OWNER>/<REPOSITORY>/workflows/<WORKFLOW_NAME>/badge.svg
- ํน์ branch์ ์ํ๋ฅผ ์กฐ๊ฑด์ผ๋ก ๊ฑธ ์ ์๋ค.
Example
Gradle๋ก ์์ฑ๋ ํ๋ก์ ํธ ๋น๋ํ๊ธฐ

name: Java CI
on: [push] # ์กฐ๊ฑด
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Gradle
run: ./gradlew build
Reference