Skip to content

Upped the node version #12

Upped the node version

Upped the node version #12

name: Build and Deploy
# workflow triggers
on:
push:
branches:
- master
workflow_dispatch:
# Allows external webhook trigger
repository_dispatch:
types:
- webhook
# build process
jobs:
pre-build:
name: Pre-Build
runs-on: ubuntu-latest
steps:
- uses: technote-space/auto-cancel-redundant-workflow@v1
- name: Cancel redundant workflows
run: echo "Cancel redundant workflows finished"
build:
name: Build
needs: pre-build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
token: ${{ secrets.PAT }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- run: npm run build
env:
CI: false
- name: Upload Build Result
uses: actions/upload-artifact@v2
with:
name: sb-build
path: public
retention-days: 1
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
steps:
- name: Download Build Result
uses: actions/download-artifact@v2
with:
name: sb-build
path: build
- name: Upload ftp
uses: SamKirkland/FTP-Deploy-Action@4.1.0
with:
server: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
password: ${{ secrets.PASS }}
protocol: ftps
local-dir: 'build/'
server-dir: 'public_html/shelleybassett.com/'