From 54b5d1b0ce4c2c141ef7eaf91fc0f2754061a5ec Mon Sep 17 00:00:00 2001 From: David Maas Date: Fri, 13 Sep 2024 19:25:02 -0500 Subject: [PATCH] Added basic CI/CD infrastructure. --- .github/workflows/Build.yml | 51 +++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .github/workflows/Build.yml diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml new file mode 100644 index 0000000..9e98dd4 --- /dev/null +++ b/.github/workflows/Build.yml @@ -0,0 +1,51 @@ +name: Build +on: + push: + branches: ['main'] + pull_request: + workflow_dispatch: +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + # ----------------------------------------------------------------------- Checkout + - name: Checkout + uses: actions/checkout@v4 + + # ----------------------------------------------------------------------- Restore library cache + - name: Restore library cache + uses: actions/cache@v3 + with: + path: Library + key: Library-${{hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**')}} + restore-keys: | + Library- + + # ----------------------------------------------------------------------- Build + - name: Build + uses: game-ci/unity-builder@v4 + env: + UNITY_LICENSE: ${{secrets.UNITY_LICENSE}} + UNITY_EMAIL: ${{secrets.UNITY_EMAIL}} + UNITY_PASSWORD: ${{secrets.UNITY_PASSWORD}} + with: + targetPlatform: WebGL + buildsPath: Build + + # ----------------------------------------------------------------------- Collect artifacts + - name: Collect build + uses: actions/upload-artifact@v4 + with: + name: Build-WebGL + if-no-files-found: error + path: Build + + - name: Collect GitHub Pages artifact + uses: actions/upload-pages-artifact@v3 + path: Build + + # ----------------------------------------------------------------------- Deploy to GitHub Pages + - name: Deploy to GitHub Pages + uses: actions/deploy-pages@v4 +