Skip to content

add vit eback

add vit eback #81

Workflow file for this run

name: deploy
on:
- push
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Cache node modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- uses: pnpm/action-setup@v3
with:
version: 8
# run_install: |
# - recursive: true
# args: [--frozen-lockfile, --strict-peer-dependencies]
# - args: [--global, prettier, typescript]
- name: install
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: |
pnpm install
- name: build
run: pnpm build
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Adding Known Hosts
run: ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hostsa
- name: Deploy with rsync
run: |
TARGET_DIR="/var/www/html/${{ steps.package-version.outputs.current-version}}"
rsync -a --rsync-path="mkdir -p $TARGET_DIR && rsync" ./build/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:$TARGET_DIR
- name: Update symlink
run: |
sudo rm -f /var/www/html/latest
sudo ln -sf /var/www/html/${{ steps.package-version.outputs.current-version}} /var/www/html/latest