Client fe448bc9d064dc2b9a762749f04ded2c212076c2 #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Client Build | |
| run-name: Client ${{ github.sha }} | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: rlespinasse/github-slug-action@v5 | |
| ################################################################ | |
| # Client Build | |
| # https://game.ci/docs/github/getting-started | |
| - uses: actions/cache@v3 | |
| with: | |
| path: src/App/Client/Library | |
| key: Library-${{ hashFiles('src/App/Client/Assets/**', 'src/App/Client/Packages/**', 'src/App/Client/ProjectSettings/**') }} | |
| restore-keys: | | |
| Library- | |
| - uses: game-ci/unity-builder@v4 | |
| env: | |
| UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} | |
| UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} | |
| UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }} | |
| with: | |
| projectPath: src/App/Client | |
| targetPlatform: WebGL | |
| buildName: client | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: client-${{ env.GITHUB_REF_POINT_SLUG }} | |
| path: build/WebGL # keep client directory in archive | |
| ################################################################ | |
| # Client Deploy | |
| # using remote server with deployed stands until CDN isn't used | |
| # TODO: use CDN for client builds, for example try Cloudflare R2 or Pages (AWS S3 isn't interesting already)) | |
| - uses: ./.github/composites/remote-ssh | |
| with: | |
| ssh_user: ${{ secrets.REMOTE_USER }} | |
| ssh_host: ${{ secrets.REMOTE_HOST }} | |
| ssh_private_key: ${{ secrets.REMOTE_PRIVATE_KEY }} | |
| step_name: Deploy Client Build | |
| step_run: | | |
| #### client build deploy | |
| set -x | |
| # ls -lR build/WebGL/client # diagnose client build content | |
| # trailing / in rsync is important to copy source directory content to different destination folder | |
| rsync -rvv --times --delete build/WebGL/client/ $SSH_TARGET:./pages/${{ env.GITHUB_REF_POINT_SLUG }}/ |