fix bugs with posts #581
Workflow file for this run
This file contains 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
# 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*" | |
concurrency: | |
# github.workflow: name of the workflow | |
# github.event.pull_request.number || github.ref: pull request number or branch name if not a pull request | |
group: ${{ github.workflow }}-${{ github.ref }} | |
# Cancel in-progress runs when a new workflow with the same group name is triggered | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
container: node:20 | |
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_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/" | |
VITE_GOOGLE_CLIENT_ID: "833085928210-2ksk1asgbmqvsg6jb3es4asnmug2a4iu.apps.googleusercontent.com" | |
VITE_GOOGLE_API_KEY: "AIzaSyAPeozJV7itoZk9Fk1VYbFCDMMXB-gU38M" | |
- 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/[email protected] | |
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/[email protected] | |
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 |