Skip to content

refactor: ♻️ Split leave and delete server routes #249

refactor: ♻️ Split leave and delete server routes

refactor: ♻️ Split leave and delete server routes #249

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: tag-release
# This workflow can be used for pushing to the production server and will only be ran when code is pushed to the main branch
on:
push:
tags:
- "v*"
jobs:
build:
runs-on: ubuntu-latest
container: node:16
steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo "VERSION=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_OUTPUT
- name: Install Node.js dependencies
run: |
npm i -g pnpm
pnpm i
- name: Build App
run: pnpm run build
env:
VITE_APP_NAME: "Nerimity"
VITE_SERVER_URL: "https://nerimity.com"
VITE_APP_URL: "https://nerimity.com"
VITE_APP_VERSION: ${{ steps.get_version.outputs.VERSION }}
VITE_MOBILE_WIDTH: 850
VITE_TURNSTILE_SITEKEY: "0x4AAAAAAABO1ilip_YaVHJk"
VITE_EMOJI_URL: "https://nerimity.com/twemojis/"
VITE_NERIMITY_CDN: "https://cdn.nerimity.com/"
- name: Zip The Build
uses: vimtor/action-zip@v1
with:
files: dist/
dest: chat-client-${{ steps.get_version.outputs.VERSION }}.zip
- name: Deploy to Server
uses: marcodallasanta/ssh-scp-deploy@v1.2.0
with:
local: 'chat-client-${{ steps.get_version.outputs.VERSION }}.zip' # Local file path - REQUIRED false - DEFAULT ./
remote: '/var/www/chat-client-${{ steps.get_version.outputs.VERSION }}.zip' # Remote file path - REQUIRED false - DEFAULT ~/
host: ${{secrets.HOST}} # Remote server address - REQUIRED true
user: ${{secrets.USER}} # Remote server user - REQUIRED true
password: ${{secrets.PASS}} # User password - REQUIRED at least one of "password" or "key"
- name: Unzip built
uses: appleboy/ssh-action@v0.1.10
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
password: ${{ secrets.PASS }}
port: ${{ secrets.PORT }}
script: |
unzip -o -DD /var/www/chat-client-${{ steps.get_version.outputs.VERSION }}.zip -d /var/www/nerimity.com/dist
rm -rf /var/www/chat-client-${{ steps.get_version.outputs.VERSION }}.zip
- name: Publish Draft Release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
draft: false
files: |
chat-client-${{ steps.get_version.outputs.VERSION }}.zip