From 110154af407e7f8c5ffa4376710b00c30ae18a0e Mon Sep 17 00:00:00 2001 From: Nick Kosarev Date: Fri, 30 Aug 2024 13:20:25 +0200 Subject: [PATCH] chore: images now on cdn, logo reworked (#248) * chore: images now on cdn, logo reworked * chore: cdn link on addon * chore: lib updates * chore: testing k8s deploy via action * fix: args * chore: auto start deploy on build * fix: name --- .../{deploy-prod.yml => deploy-k8s.yml} | 27 +++-- .env.example => apps/website/.env.example | 3 + apps/website/app/components/MainLogo.vue | 93 +++++++----------- apps/website/app/components/MenuProfile.vue | 5 +- .../website/app/pages/(games)/addon/index.vue | 2 +- apps/website/app/pages/character/[id].vue | 5 +- apps/website/app/pages/character/index.vue | 5 +- apps/website/app/pages/coupon/index.vue | 3 +- apps/website/app/pages/p/[username].vue | 9 +- apps/website/app/pages/quest/[id].vue | 5 +- apps/website/app/pages/quest/index.vue | 3 +- apps/website/app/pages/shop/index.vue | 6 +- apps/website/app/pages/trophy/[id].vue | 5 +- apps/website/app/pages/trophy/index.vue | 5 +- apps/website/nuxt.config.ts | 1 + apps/website/package.json | 9 +- apps/website/public/icons/twitch/112.png | Bin 433 -> 0 bytes apps/website/public/icons/twitch/28.png | Bin 230 -> 0 bytes apps/website/public/icons/twitch/56.png | Bin 292 -> 0 bytes apps/website/public/trophies/default/16.png | Bin 277 -> 0 bytes apps/website/public/trophies/default/32.png | Bin 323 -> 0 bytes apps/website/public/trophies/default/64.png | Bin 454 -> 0 bytes apps/website/public/units/banana/128.png | Bin 871 -> 0 bytes .../website/public/units/banana/idle.aseprite | Bin 2175 -> 0 bytes apps/website/public/units/banana/idle.gif | Bin 9812 -> 0 bytes apps/website/public/units/banana/idle.json | 53 ---------- apps/website/public/units/banana/idle.png | Bin 841 -> 0 bytes .../public/units/banana/moving.aseprite | Bin 3787 -> 0 bytes apps/website/public/units/banana/moving.json | 77 --------------- apps/website/public/units/banana/moving.png | Bin 1416 -> 0 bytes apps/website/public/units/burger/128.png | Bin 926 -> 0 bytes .../website/public/units/burger/idle.aseprite | Bin 1933 -> 0 bytes apps/website/public/units/burger/idle.gif | Bin 8778 -> 0 bytes apps/website/public/units/burger/idle.json | 45 --------- apps/website/public/units/burger/idle.png | Bin 879 -> 0 bytes .../public/units/burger/moving.aseprite | Bin 5198 -> 0 bytes apps/website/public/units/burger/moving.json | 77 --------------- apps/website/public/units/burger/moving.png | Bin 1764 -> 0 bytes apps/website/public/units/catchy/128.png | Bin 903 -> 0 bytes .../website/public/units/catchy/idle.aseprite | Bin 2242 -> 0 bytes apps/website/public/units/catchy/idle.gif | Bin 10415 -> 0 bytes apps/website/public/units/catchy/idle.json | 53 ---------- apps/website/public/units/catchy/idle.png | Bin 808 -> 0 bytes .../public/units/catchy/moving.aseprite | Bin 4916 -> 0 bytes apps/website/public/units/catchy/moving.json | 77 --------------- apps/website/public/units/catchy/moving.png | Bin 1791 -> 0 bytes apps/website/public/units/claw/128.png | Bin 993 -> 0 bytes apps/website/public/units/claw/idle.aseprite | Bin 2016 -> 0 bytes apps/website/public/units/claw/idle.gif | Bin 10970 -> 0 bytes apps/website/public/units/claw/idle.json | 45 --------- apps/website/public/units/claw/idle.png | Bin 868 -> 0 bytes .../website/public/units/claw/moving.aseprite | Bin 4664 -> 0 bytes apps/website/public/units/claw/moving.json | 77 --------------- apps/website/public/units/claw/moving.png | Bin 2120 -> 0 bytes apps/website/public/units/gentleman/128.png | Bin 1021 -> 0 bytes .../public/units/gentleman/idle.aseprite | Bin 2081 -> 0 bytes apps/website/public/units/gentleman/idle.gif | Bin 9878 -> 0 bytes apps/website/public/units/gentleman/idle.json | 45 --------- apps/website/public/units/gentleman/idle.png | Bin 987 -> 0 bytes .../public/units/gentleman/moving.aseprite | Bin 5438 -> 0 bytes .../public/units/gentleman/moving.json | 77 --------------- .../website/public/units/gentleman/moving.png | Bin 1943 -> 0 bytes apps/website/public/units/marshmallow/128.png | Bin 772 -> 0 bytes .../public/units/marshmallow/idle.aseprite | Bin 2207 -> 0 bytes .../website/public/units/marshmallow/idle.gif | Bin 7310 -> 0 bytes .../public/units/marshmallow/idle.json | 45 --------- .../website/public/units/marshmallow/idle.png | Bin 631 -> 0 bytes .../public/units/marshmallow/moving.aseprite | Bin 3607 -> 0 bytes .../public/units/marshmallow/moving.json | 77 --------------- .../public/units/marshmallow/moving.png | Bin 1403 -> 0 bytes apps/website/public/units/pup/128.png | Bin 854 -> 0 bytes apps/website/public/units/pup/idle.aseprite | Bin 1841 -> 0 bytes apps/website/public/units/pup/idle.gif | Bin 8859 -> 0 bytes apps/website/public/units/pup/idle.json | 45 --------- apps/website/public/units/pup/idle.png | Bin 759 -> 0 bytes apps/website/public/units/pup/moving.aseprite | Bin 5006 -> 0 bytes apps/website/public/units/pup/moving.json | 77 --------------- apps/website/public/units/pup/moving.png | Bin 1774 -> 0 bytes apps/website/public/units/shape/128.png | Bin 816 -> 0 bytes apps/website/public/units/shape/idle.aseprite | Bin 1978 -> 0 bytes apps/website/public/units/shape/idle.gif | Bin 7853 -> 0 bytes apps/website/public/units/shape/idle.json | 45 --------- apps/website/public/units/shape/idle.png | Bin 817 -> 0 bytes .../public/units/shape/moving.aseprite | Bin 4781 -> 0 bytes apps/website/public/units/shape/moving.json | 77 --------------- apps/website/public/units/shape/moving.png | Bin 1666 -> 0 bytes apps/website/public/units/sharky/128.png | Bin 927 -> 0 bytes .../website/public/units/sharky/idle.aseprite | Bin 2589 -> 0 bytes apps/website/public/units/sharky/idle.gif | Bin 10078 -> 0 bytes apps/website/public/units/sharky/idle.json | 45 --------- apps/website/public/units/sharky/idle.png | Bin 736 -> 0 bytes .../public/units/sharky/moving.aseprite | Bin 5420 -> 0 bytes apps/website/public/units/sharky/moving.json | 77 --------------- apps/website/public/units/sharky/moving.png | Bin 1845 -> 0 bytes apps/website/public/units/twitchy/128.png | Bin 900 -> 0 bytes .../public/units/twitchy/idle.aseprite | Bin 1780 -> 0 bytes apps/website/public/units/twitchy/idle.gif | Bin 8677 -> 0 bytes apps/website/public/units/twitchy/idle.json | 45 --------- apps/website/public/units/twitchy/idle.png | Bin 828 -> 0 bytes .../public/units/twitchy/moving.aseprite | Bin 5131 -> 0 bytes apps/website/public/units/twitchy/moving.json | 77 --------------- apps/website/public/units/twitchy/moving.png | Bin 1661 -> 0 bytes apps/website/public/units/woody/128.png | Bin 1124 -> 0 bytes apps/website/public/units/woody/idle.aseprite | Bin 2091 -> 0 bytes apps/website/public/units/woody/idle.gif | Bin 11977 -> 0 bytes apps/website/public/units/woody/idle.json | 45 --------- apps/website/public/units/woody/idle.png | Bin 1041 -> 0 bytes .../public/units/woody/moving.aseprite | Bin 4852 -> 0 bytes apps/website/public/units/woody/moving.json | 77 --------------- apps/website/public/units/woody/moving.png | Bin 2179 -> 0 bytes apps/website/public/units/wooly/128.png | Bin 845 -> 0 bytes apps/website/public/units/wooly/idle.aseprite | Bin 2010 -> 0 bytes apps/website/public/units/wooly/idle.gif | Bin 9007 -> 0 bytes apps/website/public/units/wooly/idle.json | 45 --------- apps/website/public/units/wooly/idle.png | Bin 817 -> 0 bytes .../public/units/wooly/moving.aseprite | Bin 5595 -> 0 bytes apps/website/public/units/wooly/moving.json | 77 --------------- apps/website/public/units/wooly/moving.png | Bin 1885 -> 0 bytes apps/website/server/plugins/start.ts | 7 ++ .../server/utils/twitch/twitch.provider.ts | 5 + package.json | 4 +- packages/addon/package.json | 3 +- packages/addon/src/lib/baseGameAddon.ts | 7 +- .../addon/src/lib/objects/unit/unitObject.ts | 10 +- packages/addon/src/lib/types.ts | 1 + packages/types/src/lib/types.ts | 2 - pnpm-lock.yaml | 56 +++++------ 127 files changed, 144 insertions(+), 1617 deletions(-) rename .github/workflows/{deploy-prod.yml => deploy-k8s.yml} (64%) rename .env.example => apps/website/.env.example (91%) delete mode 100644 apps/website/public/icons/twitch/112.png delete mode 100644 apps/website/public/icons/twitch/28.png delete mode 100644 apps/website/public/icons/twitch/56.png delete mode 100644 apps/website/public/trophies/default/16.png delete mode 100644 apps/website/public/trophies/default/32.png delete mode 100644 apps/website/public/trophies/default/64.png delete mode 100644 apps/website/public/units/banana/128.png delete mode 100644 apps/website/public/units/banana/idle.aseprite delete mode 100644 apps/website/public/units/banana/idle.gif delete mode 100644 apps/website/public/units/banana/idle.json delete mode 100644 apps/website/public/units/banana/idle.png delete mode 100644 apps/website/public/units/banana/moving.aseprite delete mode 100644 apps/website/public/units/banana/moving.json delete mode 100644 apps/website/public/units/banana/moving.png delete mode 100644 apps/website/public/units/burger/128.png delete mode 100644 apps/website/public/units/burger/idle.aseprite delete mode 100644 apps/website/public/units/burger/idle.gif delete mode 100644 apps/website/public/units/burger/idle.json delete mode 100644 apps/website/public/units/burger/idle.png delete mode 100644 apps/website/public/units/burger/moving.aseprite delete mode 100644 apps/website/public/units/burger/moving.json delete mode 100644 apps/website/public/units/burger/moving.png delete mode 100644 apps/website/public/units/catchy/128.png delete mode 100644 apps/website/public/units/catchy/idle.aseprite delete mode 100644 apps/website/public/units/catchy/idle.gif delete mode 100644 apps/website/public/units/catchy/idle.json delete mode 100644 apps/website/public/units/catchy/idle.png delete mode 100644 apps/website/public/units/catchy/moving.aseprite delete mode 100644 apps/website/public/units/catchy/moving.json delete mode 100644 apps/website/public/units/catchy/moving.png delete mode 100644 apps/website/public/units/claw/128.png delete mode 100644 apps/website/public/units/claw/idle.aseprite delete mode 100644 apps/website/public/units/claw/idle.gif delete mode 100644 apps/website/public/units/claw/idle.json delete mode 100644 apps/website/public/units/claw/idle.png delete mode 100644 apps/website/public/units/claw/moving.aseprite delete mode 100644 apps/website/public/units/claw/moving.json delete mode 100644 apps/website/public/units/claw/moving.png delete mode 100644 apps/website/public/units/gentleman/128.png delete mode 100644 apps/website/public/units/gentleman/idle.aseprite delete mode 100644 apps/website/public/units/gentleman/idle.gif delete mode 100644 apps/website/public/units/gentleman/idle.json delete mode 100644 apps/website/public/units/gentleman/idle.png delete mode 100644 apps/website/public/units/gentleman/moving.aseprite delete mode 100644 apps/website/public/units/gentleman/moving.json delete mode 100644 apps/website/public/units/gentleman/moving.png delete mode 100644 apps/website/public/units/marshmallow/128.png delete mode 100644 apps/website/public/units/marshmallow/idle.aseprite delete mode 100644 apps/website/public/units/marshmallow/idle.gif delete mode 100644 apps/website/public/units/marshmallow/idle.json delete mode 100644 apps/website/public/units/marshmallow/idle.png delete mode 100644 apps/website/public/units/marshmallow/moving.aseprite delete mode 100644 apps/website/public/units/marshmallow/moving.json delete mode 100644 apps/website/public/units/marshmallow/moving.png delete mode 100644 apps/website/public/units/pup/128.png delete mode 100644 apps/website/public/units/pup/idle.aseprite delete mode 100644 apps/website/public/units/pup/idle.gif delete mode 100644 apps/website/public/units/pup/idle.json delete mode 100644 apps/website/public/units/pup/idle.png delete mode 100644 apps/website/public/units/pup/moving.aseprite delete mode 100644 apps/website/public/units/pup/moving.json delete mode 100644 apps/website/public/units/pup/moving.png delete mode 100644 apps/website/public/units/shape/128.png delete mode 100644 apps/website/public/units/shape/idle.aseprite delete mode 100644 apps/website/public/units/shape/idle.gif delete mode 100644 apps/website/public/units/shape/idle.json delete mode 100644 apps/website/public/units/shape/idle.png delete mode 100644 apps/website/public/units/shape/moving.aseprite delete mode 100644 apps/website/public/units/shape/moving.json delete mode 100644 apps/website/public/units/shape/moving.png delete mode 100644 apps/website/public/units/sharky/128.png delete mode 100644 apps/website/public/units/sharky/idle.aseprite delete mode 100644 apps/website/public/units/sharky/idle.gif delete mode 100644 apps/website/public/units/sharky/idle.json delete mode 100644 apps/website/public/units/sharky/idle.png delete mode 100644 apps/website/public/units/sharky/moving.aseprite delete mode 100644 apps/website/public/units/sharky/moving.json delete mode 100644 apps/website/public/units/sharky/moving.png delete mode 100644 apps/website/public/units/twitchy/128.png delete mode 100644 apps/website/public/units/twitchy/idle.aseprite delete mode 100644 apps/website/public/units/twitchy/idle.gif delete mode 100644 apps/website/public/units/twitchy/idle.json delete mode 100644 apps/website/public/units/twitchy/idle.png delete mode 100644 apps/website/public/units/twitchy/moving.aseprite delete mode 100644 apps/website/public/units/twitchy/moving.json delete mode 100644 apps/website/public/units/twitchy/moving.png delete mode 100644 apps/website/public/units/woody/128.png delete mode 100644 apps/website/public/units/woody/idle.aseprite delete mode 100644 apps/website/public/units/woody/idle.gif delete mode 100644 apps/website/public/units/woody/idle.json delete mode 100644 apps/website/public/units/woody/idle.png delete mode 100644 apps/website/public/units/woody/moving.aseprite delete mode 100644 apps/website/public/units/woody/moving.json delete mode 100644 apps/website/public/units/woody/moving.png delete mode 100644 apps/website/public/units/wooly/128.png delete mode 100644 apps/website/public/units/wooly/idle.aseprite delete mode 100644 apps/website/public/units/wooly/idle.gif delete mode 100644 apps/website/public/units/wooly/idle.json delete mode 100644 apps/website/public/units/wooly/idle.png delete mode 100644 apps/website/public/units/wooly/moving.aseprite delete mode 100644 apps/website/public/units/wooly/moving.json delete mode 100644 apps/website/public/units/wooly/moving.png diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-k8s.yml similarity index 64% rename from .github/workflows/deploy-prod.yml rename to .github/workflows/deploy-k8s.yml index f50ed010..aaf92abb 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-k8s.yml @@ -1,11 +1,15 @@ -name: Deploy Docker Image on Prod +name: Deploy Docker Image on k8s on: + workflow_run: + workflows: ["Build and Push Docker"] + types: + - completed workflow_dispatch: env: APP_URL: https://chatgame.space - APP_ENV: production + APP_ENV: website-production jobs: deploy: @@ -26,19 +30,12 @@ jobs: environment-url: ${{ env.APP_URL }} environment: ${{ env.APP_ENV }} - - name: Install ssh keys - # check this thread to understand why its needed: - # - run: | - install -m 600 -D /dev/null ~/.ssh/id_rsa - echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa - ssh-keyscan -H ${{ secrets.SSH_HOST }} > ~/.ssh/known_hosts - - - name: Connect and pull - run: ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "cd ${{ secrets.WORK_DIR }} && docker compose pull && docker compose up -d && docker image prune -f && exit" - - - name: Cleanup - run: rm -rf ~/.ssh + - name: Connect to k8s cluster and restart deployment + uses: actions-hub/kubectl@master + env: + KUBE_CONFIG: ${{ secrets.KUBE_CONFIG }} + with: + args: rollout restart deployment/website-deployment -n chat-game - name: Update deployment status (success) if: success() diff --git a/.env.example b/apps/website/.env.example similarity index 91% rename from .env.example rename to apps/website/.env.example index 8db91089..310278fb 100644 --- a/.env.example +++ b/apps/website/.env.example @@ -17,6 +17,9 @@ NUXT_SESSION_PASSWORD="" # WebSocket server with event messages NUXT_PUBLIC_WEBSOCKET_URL="ws://localhost:4200/api/websocket" +# CDN or S3 bucket +NUXT_PUBLIC_CDN_URL="" + # Database DATABASE_URL="" diff --git a/apps/website/app/components/MainLogo.vue b/apps/website/app/components/MainLogo.vue index bddb0e98..82ac435f 100644 --- a/apps/website/app/components/MainLogo.vue +++ b/apps/website/app/components/MainLogo.vue @@ -1,88 +1,71 @@ diff --git a/apps/website/app/components/MenuProfile.vue b/apps/website/app/components/MenuProfile.vue index a10a5f41..971132dd 100644 --- a/apps/website/app/components/MenuProfile.vue +++ b/apps/website/app/components/MenuProfile.vue @@ -5,7 +5,7 @@ class="profile-avatar" @click="handleMenuClick" > - + Войти @@ -14,10 +14,13 @@