Skip to content

fix: random events

fix: random events #73

Workflow file for this run

name: Deploy bot
on:
push:
branches:
- main
jobs:
lint:
env:
NODE_VERSION: 20.x
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: pnpm/action-setup@v2
with:
version: 8.3.0
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'pnpm'
- name: install and lint
run: pnpm install --no-frozen-lockfile
- name: run lint
run: pnpm run lint
- name: run ts-ts-check
run: pnpm run ts-check
- name: check ts
run: tsc
- name: sentry sourcemap upload
run: pnpm sentry:sourcemaps
deploy:
needs: [lint]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build Docker image
run: docker build -t rgd-bot:latest .
- name: Save Docker image as tar file
run: docker save -o rgd-bot.tar rgd-bot:latest
- name: Transfer Docker image to remote server
run: |
mkdir -p ~/.ssh
echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
scp -o StrictHostKeyChecking=no rgd-bot.tar ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.REMOTE_PATH }}
- name: Load Docker image on remote server
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} << 'ENDSSH'
docker load -i ${{ secrets.REMOTE_PATH }}/rgd-bot.tar
ENDSSH
- name: Transfer Docker Compose file to remote server
run: |
scp -o StrictHostKeyChecking=no docker-compose.yml ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }}:${{ secrets.REMOTE_PATH }}
- name: Deploy Docker containers using Docker Compose on remote server
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} << 'ENDSSH'
docker compose -f ${{ secrets.REMOTE_PATH }}/docker-compose.yml up -d
ENDSSH