Skip to content

Merge pull request #108 from SilverCareOrg/stefan #91

Merge pull request #108 from SilverCareOrg/stefan

Merge pull request #108 from SilverCareOrg/stefan #91

Workflow file for this run

name: React App CI/CD
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
env:
REACT_APP_SERVER_IMAGE_PATH: ${{ secrets.REACT_APP_SERVER_IMAGE_PATH }}
REACT_APP_API: ${{ secrets.REACT_APP_API }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: '16' # Specify the Node.js version
- name: Delete node_modules
run: rm -rf node_modules/
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Build
run: yarn run build
- name: Deploy to Ubuntu Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_ADDR }}
username: stefan
key: ${{ secrets.SERVER_KEY }}
passphrase: ${{ secrets.SSH_PASSPHRASE }}
port: 22
source: build/ # Adjust this path to your build output
target: /home/stefan/frontend/
- name: Clean up
run: rm -rf build/