Skip to content

Merge pull request #64 from sonastea/feature/native-ws-popsocket-service #127

Merge pull request #64 from sonastea/feature/native-ws-popsocket-service

Merge pull request #64 from sonastea/feature/native-ws-popsocket-service #127

Workflow file for this run

name: Client
on:
push:
branches: ['master']
paths: ['.github/workflows/client.yml', 'client/**']
workflow_dispatch:
jobs:
build-client:
runs-on: ubuntu-latest
env:
VITE_API_URL: ${{ secrets.VITE_API_URL }}
VITE_MESSAGES_WS_URL: ${{ secrets.VITE_MESSAGES_WS_URL }}
VITE_SITE_KEY: ${{ secrets.VITE_SITE_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4.0.2
with:
node-version: 20
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
working-directory: client
run: pnpm install
- name: Build production client
working-directory: client
run: pnpm build
- name: Upload production client
uses: actions/upload-artifact@v4
with:
name: kpoppop-client-${{ github.sha }}
path: client/build
deploy-client:
needs: build-client
runs-on: ubuntu-latest
steps:
- name: Download production client artifact
uses: actions/download-artifact@v4
with:
name: kpoppop-client-${{ github.sha }}
path: ${{ github.workspace }}/tmp/kpoppop-client/
- name: Deploy production client to server
uses: burnett01/rsync-deployments@7.0.1
with:
switches: -azvrP --delete --exclude models
path: tmp/kpoppop-client/
remote_path: ${{ secrets.SSH_PATH }}
remote_host: ${{ secrets.SSH_HOST }}
remote_port: ${{ secrets.SSH_PORT }}
remote_user: ${{ secrets.SSH_USER }}
remote_key: ${{ secrets.SSH_DEPLOY_KEY }}