fix: coinmarketcap portfolio #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- '**/*' | |
- '!**/*.md' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Copy project to server | |
uses: appleboy/scp-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: 22 | |
source: "." # Copies the entire project directory | |
target: ${{ secrets.TARGET_PATH }} | |
rm: true | |
- name: Build and Run Docker Container on server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.SSH_HOST }} | |
username: ${{ secrets.SSH_USERNAME }} | |
key: ${{ secrets.SSH_PRIVATE_KEY }} | |
port: 22 | |
script: | | |
set -x | |
cd ${{ secrets.TARGET_PATH }} | |
export TELEGRAM_BOT_NAME="${{ secrets.TELEGRAM_BOT_NAME }}" | |
export TELEGRAM_BOT_TOKEN="${{ secrets.TELEGRAM_BOT_TOKEN }}" | |
export TG_ADMIN="${{ secrets.TG_ADMIN }}" | |
export MONGO_DB_URI="${{ secrets.MONGO_DB_URI }}" | |
export KUCOIN_API_KEY="${{ secrets.KUCOIN_API_KEY }}" | |
export KUCOIN_SECRET_KEY="${{ secrets.KUCOIN_SECRET_KEY }}" | |
export KUCOIN_PASSPHRASE="${{ secrets.KUCOIN_PASSPHRASE }}" | |
docker-compose up --build -d | |
docker images -q -f "dangling=true" | xargs docker rmi -f |