Skip to content

πŸ‘· Create build-and-deploy.yml #1

πŸ‘· Create build-and-deploy.yml

πŸ‘· Create build-and-deploy.yml #1

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: Build and Deploy
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout πŸ›ŽοΈ
uses: actions/checkout@v3
- name: Node Version Change βž•
uses: actions/setup-node@v3
with:
node-version: 16
- name: Use Pnpm βž•
uses: pnpm/action-setup@v2
with:
version: 6
run_install: false
- name: Install and Build πŸ”§
run: |
pnpm i
pnpm build
# Deploy
- name: Deploy
uses: easingthemes/[email protected]
env:
SSH_PRIVATE_KEY: ${{ secrets.ACCESS_TOKEN }}
ARGS: "-avz --delete"
SOURCE: "build/"
REMOTE_HOST: ${{ secrets.REMOTE_HOST }}
REMOTE_USER: ${{ secrets.REMOTE_USER }}
TARGET: ${{ secrets.TARGET }}