Skip to content

test: test

test: test #16

Workflow file for this run

name: Test and Deploy
on:
push:
paths:
- 'src/**'
- 'package.json'
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
test:
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: yarn install
- name: Run tests
run: yarn test
deploy:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/develop'
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up SSH key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Deploy to server
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOSTNAME }} << 'EOF'
cd ~/wink-official-backend
git pull origin develop
echo "${{ secrets.CICD_DOCKER_ENV }}" > cicd.docker.env
docker compose build
docker compose down
docker compose up -d
EOF