Merge pull request #42 from frontend-park-mail-ru/redesign #10
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
on: | |
push: | |
branches: | |
- main | |
- dev | |
- deploy | |
workflow_dispatch: | |
inputs: | |
assemblyType: | |
description: 'Assembly type' | |
required: true | |
type: choice | |
options: | |
- prod | |
- develop | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install Node | |
uses: actions/[email protected] | |
with: | |
node-version: 21 | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Install dependencies | |
run: npm ci | |
- name: Build | |
run: | | |
if [ "${{ inputs.assemblyType }}" == "prod" ]; then | |
echo "Build production" | |
npm run build-prod | |
elif [ "${{ inputs.assemblyType }}" == "develop" ]; then | |
echo "Build develop" | |
npm run build | |
else | |
echo "Build production" | |
npm run build-prod | |
fi | |
- name: Upload build result | |
uses: actions/[email protected] | |
with: | |
name: build | |
path: ./dist | |
deploy: | |
runs-on: ubuntu-latest | |
needs: build | |
steps: | |
- name: Download build | |
uses: actions/[email protected] | |
with: | |
name: build | |
path: build | |
- name: Deploy files to server | |
uses: appleboy/scp-action@master | |
with: | |
host: umlaut-bmstu.me | |
username: ubuntu | |
key: ${{ secrets.SSH_KEY }} | |
source: build/* | |
target: /home/ubuntu/front/2023_2_Umlaut/dist | |
strip_components: 1 | |
overwrite: true |