fix: remove npm ci #6
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
name: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build-test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '20' | |
- name: Install dependencies | |
run: npm install | |
- name: Run build | |
run: npm run build | |
- name: Run tests | |
run: npm test | |
deploy: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
needs: build-test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Deploy to server via SSH | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_KEY }} | |
passphrase: ${{ secrets.SSH_PASSPHRASE }} | |
script: | | |
rm -rf portfolio | |
git clone https://github.com/beelchester/3D-Portfolio.git portfolio | |
cd portfolio | |
yarn dev --host | |