Skip to content

changes

changes #4

# 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: Frontend CI
on:
push:
branches:
- develop
- main
pull_request:
branches:
- develop
- main
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: 'client'
strategy:
matrix:
node-version: [22.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Recreate .env from secret
run: echo "${{ secrets.PROD_ENV_FILE }}" > .env
- run: npm ci
- run: npm run build
# - name: Deploy to EC2
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.EC2_HOST }}
# username: ${{ secrets.EC2_USER }}
# key: ${{ secrets.EC2_SSH_KEY }}
# source: "frontend/dist/*"
# target: "/var/www/notetify-frontend"
#- name: Reload Nginx
# uses: appleboy/[email protected]
# with:
# host: ${{ secrets.EC2_HOST }}
# username: ${{ secrets.EC2_USER }}
# key: ${{ secrets.EC2_SSH_KEY }}
# script: |
# sudo systemctl reload nginx