Skip to content

ci(Github Actions): add main-build-deploy action triggered on a new v… #1

ci(Github Actions): add main-build-deploy action triggered on a new v…

ci(Github Actions): add main-build-deploy action triggered on a new v… #1

name: Build and Deploy (main channel)
on:
push:
tags:
- 'v*'
jobs:
main-build-deploy:
runs-on: ubuntu-latest
environment:
name: main-production
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: main
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
run: npm install
- name: Build the website
run: npm run build
- name: Deploy to the server
uses: easingthemes/ssh-deploy@main
with:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
SOURCE: "dist/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
REMOTE_PORT: ${{ secrets.REMOTE_PORT }}
TARGET: ${{ secrets.REMOTE_TARGET }}
EXCLUDE: "/dist/, /node_modules/"