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 @@