testing #9
Workflow file for this run
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 | |
on: | |
push: | |
branches: | |
- main | |
- ci | |
workflow_dispatch: | |
jobs: | |
build-and-deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20" | |
- name: Install dependencies | |
run: npm install | |
- name: Run linting and typechecking | |
run: npm run check | |
- name: Run tests | |
run: npm test | |
- name: Build project | |
run: npm run build | |
- name: Upload dist to remote server | |
uses: appleboy/scp-action@v0.1.2 | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
password: ${{ secrets.REMOTE_PASSWORD }} | |
target: ./dist | |
source: ./dist/* | |
rm: true | |
strip_components: 1 | |
- name: Execute remote commands | |
uses: appleboy/ssh-action@v0.1.2 | |
with: | |
host: ${{ secrets.REMOTE_HOST }} | |
username: ${{ secrets.REMOTE_USER }} | |
password: ${{ secrets.REMOTE_PASSWORD }} | |
script: | | |
pm2 restart artifacts |