Skip to content

Merge pull request #54 from axe-api/dependabot/npm_and_yarn/nodemon-3… #59

Merge pull request #54 from axe-api/dependabot/npm_and_yarn/nodemon-3…

Merge pull request #54 from axe-api/dependabot/npm_and_yarn/nodemon-3… #59

Workflow file for this run

name: Deployment
on:
push:
branches:
- "master"
jobs:
dockerize:
name: Dockerize
runs-on: ubuntu-latest
env:
DO_PASSWORD: ${{ secrets.DO_PASSWORD }}
steps:
- uses: actions/checkout@v3
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Install
run: npm install
- name: Build
run: npm run build
- name: Build, tag and push
run: |
cd build
docker build -t ozziest/bookstore:latest .
docker push ozziest/bookstore:latest
- name: Deployment to production
run: sshpass -p "$DO_PASSWORD" ssh -o StrictHostKeyChecking=no -o PreferredAuthentications=password [email protected] 'cd /home/composes/bookstore && docker compose pull && docker compose down && docker compose up -d && docker system prune --force'