Skip to content

Merge pull request #110 from ecency/l10n_develop #38

Merge pull request #110 from ecency/l10n_develop

Merge pull request #110 from ecency/l10n_develop #38

Workflow file for this run

name: Main CI/CD
on:
push:
branches:
- main
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install, lint and/or test
run: |
yarn
yarn test --runInBand --updateSnapshot
env:
CI: true
build:
needs: tests
runs-on: ubuntu-latest
steps:
- name: Check Out Repo
uses: actions/checkout@v2
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: ecency/hivexplorer:latest
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
deploy-EU:
needs: build
runs-on: ubuntu-latest
steps:
- name: SSH and deploy node app
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST_EU }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
envs:
script: |
cd ~/hivexplorer
git pull origin main
docker pull ecency/hivexplorer:latest
docker stack deploy -c docker-compose.yml -c docker-compose.production.yml hivexplorer