Skip to content

Commit

Permalink
ci: add docker to github workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Guilhermeasper committed Aug 27, 2024
1 parent 086ae93 commit 9d06653
Showing 1 changed file with 28 additions and 11 deletions.
39 changes: 28 additions & 11 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,48 @@ name: Node.js CI

on:
push:
branches: ['main']
pull_request:
branches: ['main']
branches: ['ci/add-docker']

jobs:
build:
runs-on: [self-hosted, Linux, X64, marquinhos]

strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

deploy:
needs: build
runs-on: [self-hosted, Linux, X64, marquinhos]

steps:
- name: Make deploy.sh executable
run: chmod +x ./deploy.sh
- name: Execute deploy.sh
run: echo "${{ secrets.DVNS_CLUSTER_PASSWORD }}" | sudo -S ./deploy.sh "$(pwd)/dist"
- name: Stop Marquinhos
run: docker-compose down

- name: Build and run Marquinhos
run: docker-compose up -d --build

- name: Check status
run: |
if docker ps | grep -q marquinhosbot && docker ps | grep marquinhosbot | grep -q Up; then
echo "Marquinhos is running"
else
echo "Marquinhos is not running"
exit 1
fi

0 comments on commit 9d06653

Please sign in to comment.