Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Merge pull request #2 from Dungeon-MASSters/master #6

Merge pull request #2 from Dungeon-MASSters/master

Merge pull request #2 from Dungeon-MASSters/master #6

# 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: Deploy frontend
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache-dependency-path: frontend/MASSter-frontend/package-lock.json
- run: npm ci
working-directory: frontend/MASSter-frontend
- run: npm run build
working-directory: frontend/MASSter-frontend
- name: Save build
uses: actions/upload-artifact@v3
with:
name: frontend-static
path: frontend/MASSter-frontend/dist
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Get build
uses: actions/download-artifact@v3
with:
name: frontend-static
path: build
- name: List build
run: ls -la build
- name: Deploy to server
uses: easingthemes/ssh-deploy@main
env:
SSH_PRIVATE_KEY: ${{ secrets.DEPLOY_KEY }}
ARGS: "-rltgoDzvO --delete"
SOURCE: "build/"
REMOTE_HOST: ${{ secrets.DEPLOY_HOST }}
REMOTE_USER: ${{ secrets.DEPLOY_USER }}
TARGET: ${{ secrets.DEPLOY_TARGET }}