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

Commit

Permalink
Create deploy-frontend.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
NikonP authored Oct 14, 2023
1 parent 8064667 commit 6b5070c
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/deploy-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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'
- run: npm ci
- run: npm run build
- 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 }}

0 comments on commit 6b5070c

Please sign in to comment.