Skip to content

refactor CI/CD

refactor CI/CD #23

Workflow file for this run

name: Deploy
on:
push:
branches:
- main # Deploy on push to the main branch
jobs:
deploy:
runs-on: ubuntu-latest
environment: ikarus.arrow-silver.com
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: executing remote ssh commands
uses: appleboy/[email protected]
with:
host: ${{ secrets.VPS_IP }}
username: ${{ secrets.DEPLOY_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /root/projects/ikarus || exit
git checkout .
git checkout main
git pull origin main
sudo docker-compose down
sudo docker-compose build --no-cache
echo "ENVIRONMENT=release" > app.env
echo "DB_SOURCE=${{ secrets.DB_SOURCE }}" >> app.env
echo "HTTP_SERVER_ADDRESS=${{ secrets.HTTP_SERVER_ADDRESS }}" >> app.env
echo "TOKEN_SYMMETRIC_KEY=${{ secrets.TOKEN_SYMMETRIC_KEY }}" >> app.env
echo "DOMAIN_ADDRESS=${{ secrets.DOMAIN }}" >> app.env
echo "SESSION_NAME=${{ secrets.SESSION_NAME }}" >> app.env
sudo DOMAIN_ADDRESS=${{ secrets.DOMAIN }} docker-compose up -d
sudo docker system prune -f