Skip to content

Merge pull request #240 from El-swaggerito/feat/advanced-storage-and-… #68

Merge pull request #240 from El-swaggerito/feat/advanced-storage-and-…

Merge pull request #240 from El-swaggerito/feat/advanced-storage-and-… #68

Workflow file for this run

name: Deploy Pipeline
on:
push:
branches: [ main, develop ]
tags: [ 'v*' ]
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: docker/production.dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/verinode:${{ github.sha }}
${{ secrets.DOCKERHUB_USERNAME }}/verinode:latest
deploy-dev:
needs: build-and-push
if: github.ref == 'refs/heads/develop'
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v3
- name: Deploy to Dev
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.DEV_HOST }}
username: ${{ secrets.DEV_USERNAME }}
key: ${{ secrets.DEV_SSH_KEY }}
script: |
export DOCKER_TAG=${{ github.sha }}
cd /app/verinode
git pull
chmod +x scripts/*.sh
./scripts/deploy.sh dev
deploy-staging:
needs: build-and-push
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v3
- name: Deploy to Staging
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.STAGING_HOST }}
username: ${{ secrets.STAGING_USERNAME }}
key: ${{ secrets.STAGING_SSH_KEY }}
script: |
export DOCKER_TAG=${{ github.sha }}
cd /app/verinode
git pull
chmod +x scripts/*.sh
./scripts/deploy.sh staging
deploy-prod:
needs: build-and-push
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v3
- name: Deploy to Production
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.PROD_HOST }}
username: ${{ secrets.PROD_USERNAME }}
key: ${{ secrets.PROD_SSH_KEY }}
script: |
export DOCKER_TAG=${{ github.sha }}
cd /app/verinode
git pull
chmod +x scripts/*.sh
./scripts/deploy.sh prod