오늘 시간에는 간단하게 workflow를 작성해 보고 이를 실행하는 과정까지 진행해 보겠습니다.
아래의 문서를 참고하여 workflow를 작성해 보겠습니다.
Github Actions 사용 시 유의사항
- Github Enterprise 계정이 아니라면 private 저장소는 Actions이 불가능하다.
- Unity를 연동하게 되면 email, password, lisense에 대한 정보 입력이 필요하다.
- workflow작성은 yml 파일 형태로 작성하게 된다.
GitHubActions Workflow Create

- Actions Tab을 클릭하여 Actions 페이지로 이동합니다.
- New workflow -> workflow 생성

- set up a workflow your self 버튼을 클릭하여 직접 workflow 생성
- 또는 이미 공개되어 있는 많은 workflows들을 검색하여 추가
여기서는 직접 작성하여 workflow를 생성해 보겠습니다.
github-actions-demo.yml
name: GitHub Actions Demo
run-name: ${{ github.actor }} is testing out GitHub Actions 🚀
on: [push]
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "🖥️ The workflow is now ready to test your code on the runner."
- name: List files in the repository
run: |
ls ${{ github.workspace }}
- run: echo "🍏 This job's status is ${{ job.status }}."
해당 workflow는 github actions이 동작하는 간단한 예제로 event의 name은 무엇인지, runner의 os는 무엇인지 repository이름, job의 상태를 출력하는 등 workflow 전반적인 정보를 출력하여 동작하는 것을 보여주고 있습니다.

추가적으로 해당 Jobs이 트리거 되는 시점을 수정해 보겠습니다. event가 트리거 되는 시점은 yml파일 on: 구문에서 정의됩니다. 간단한 정의를 살펴보겠습니다.


위 이미지처럼 여러 event 시점을 workflow에 등록할 수 있고 그럴 때마다 actions이 동작하는 것을 알 수 있습니다.
다음 시간에는 Unity의 빌드를 Github actions을 통해 별도의 컴퓨터의 자원을 활용하지 않고 Github의 Cloud에서 빌드를 진행한 뒤 apk 파일을 확인해 볼 수 있는 것을 진행해 보겠습니다.
'Unity' 카테고리의 다른 글
Unity Git hub Acitons - 4 (Game-ci/unity-builder) (1) | 2025.03.13 |
---|---|
Unity Git hub Acitons - 3 (Unity 연동) (0) | 2025.03.01 |
Unity Git hub Actions - 1 (개념 정리) (0) | 2025.02.25 |
Addressable Asset (6) - Download Progress 처리 (0) | 2025.02.16 |
Unity Addressable Asset (5) (0) | 2025.02.13 |