github → profile → setting → Developer settings → Personal access tokens 에서 생성action을 사용할 github repository의 탭메뉴에서 actions에 들어가 new workflow 버튼을 클릭하고
.github/workflows/main.yml 파일을 생성, 아래 순서대로 setting해주면 된다.
name: Actions 😎
on: [push, pull_request]
jobs:
build:
name: Build my project ✨
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout repository
uses: actions/checkout@v2
with:
lfs: true
# Cache
- uses: actions/cache@v2
with:
path: Library
key: Library
# Test
- name: Run tests
uses: game-ci/unity-test-runner@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
# Build
- name: Build project
uses: game-ci/unity-builder@v2
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
targetPlatform: WebGL
# Output
- uses: actions/upload-artifact@v2
with:
name: Build
path: build