ci(Github Actions): add main-build-deploy action triggered on a new v… #1
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
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/" |