@@ -14,22 +14,24 @@ permissions:
1414concurrency :
1515 group : " pages"
1616 cancel-in-progress : false
17+
1718jobs :
1819 build :
1920 name : Unity Build 👽
2021 runs-on : ubuntu-latest
2122 steps :
2223 # Checkout (without LFS)
2324 - name : Checkout repository
24- uses : actions/checkout@v2
25+ uses : actions/checkout@v4
2526 with :
26- token : ${{secrets.PAT}}
27+ token : ${{ secrets.PAT }}
28+
2729 # Git LFS
2830 - name : Create LFS file list
2931 run : git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id
3032
3133 - name : Restore LFS cache
32- uses : actions/cache@v2
34+ uses : actions/cache@v4
3335 id : lfs-cache
3436 with :
3537 path : .git/lfs
@@ -41,15 +43,15 @@ jobs:
4143 git add .
4244 git reset --hard
4345
44- # # Cache
45- - uses : actions/cache@v2
46+ # Cache de Library de Unity
47+ - uses : actions/cache@v4
4648 with :
4749 path : Library
4850 key : Library-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
4951 restore-keys : |
5052 Library-
5153
52- # # Build
54+ # Build
5355 - name : Build project
5456 uses : game-ci/unity-builder@v4
5557 env :
@@ -60,12 +62,17 @@ jobs:
6062 targetPlatform : ${{ vars.TARGET_PLATFORM }}
6163 buildsPath : ${{ vars.BUILD_PATH }}
6264 allowDirtyBuild : true
65+ # Si tu proyecto está en 2022.3.59f1 y quieres fijarlo explícitamente,
66+ # descomenta la siguiente línea (no cambia funcionalidad si coincide):
67+ # unityVersion: 2022.3.59f1
68+
6369 # Output: Artifact
6470 - name : Upload Build Artifact
65- uses : actions/upload-artifact@v3
71+ uses : actions/upload-artifact@v4
6672 with :
6773 name : ${{ vars.ARTIFACT_NAME }}
6874 path : ${{ vars.BUILD_PATH }}
75+
6976 # Deployment
7077 - name : Stash build result and reset local changes
7178 run : |
7986 git stash list
8087 git reset --hard
8188 sudo git clean -d -x -f
82- # Deployment
89+
8390 - name : Cleaning gh-pages branch
8491 run : |
8592 echo "Switch to ${{ vars.DEPLOYMENT_BRANCH }}"
@@ -88,12 +95,14 @@ jobs:
8895 sudo git clean -d -x -f
8996 rm -r *
9097 git add *
91- git commit -m "cleaning branch"
98+ git commit -m "cleaning branch" || echo "Nothing to commit"
9299 git push
100+
93101 - name : Applying stashed files to ${{ vars.DEPLOYMENT_BRANCH }}
94102 run : |
95103 echo "Applying stash"
96104 git stash apply stash@{0}
105+
97106 - name : Copying files to root directory
98107 run : |
99108 cd ${{ vars.BUILD_PATH }}/${{ vars.TARGET_PLATFORM }}/${{ vars.TARGET_PLATFORM }}
@@ -103,12 +112,13 @@ jobs:
103112 rm -r ${{ vars.BUILD_PATH }}
104113 ls
105114 pwd
115+
106116 - name : Pushing deployment to gh-pages branch
107117 run : |
108118 pwd
109119 git status
110120 git add *
111- git commit -m "Deployment"
121+ git commit -m "Deployment" || echo "Nothing to commit"
112122 git push
113123 git reset --hard
114- sudo git clean -d -x -f
124+ sudo git clean -d -x -f
0 commit comments