changes #14
This file contains hidden or 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
| # 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: 'frontend' | |
| 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 | |
| - name: Run tests | |
| run: npm test | |
| - run: npm run build | |
| # - name: Deploy to EC2 | |
| # uses: appleboy/scp-action@v0.1.4 | |
| # 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/ssh-action@v1.0.0 | |
| # with: | |
| # host: ${{ secrets.EC2_HOST }} | |
| # username: ${{ secrets.EC2_USER }} | |
| # key: ${{ secrets.EC2_SSH_KEY }} | |
| # script: | | |
| # sudo systemctl reload nginx | |