Skip to content

check-disk-space

check-disk-space #712

name: check-disk-space
on:
schedule:
- cron: '00 00 * * *'
jobs:
deploy:
name: Check used disk space
environment: production
runs-on: ubuntu-22.04
env:
APP_DIR: '${HOME}/prd/app'
SSH_HOST: ${{ secrets.SSH_HOST }}
SSH_KEY: ${{ secrets.SSH_KEY }}
SSH_PORT: ${{ secrets.SSH_PORT }}
SSH_USER_WEB: ${{ secrets.SSH_USER_WEB }}
steps:
- name: Setup SSH key
run: |
mkdir -p ~/.ssh/
ssh-keyscan -H ${SSH_HOST} >> ~/.ssh/known_hosts
eval `ssh-agent -s`
echo "${SSH_KEY}" | tr -d '\r' | ssh-add -
echo "SSH_AUTH_SOCK=$SSH_AUTH_SOCK" >> $GITHUB_ENV
- name: Check disk space
run: ssh ${SSH_USER_WEB}@${SSH_HOST} -p ${SSH_PORT} "cd ${APP_DIR} && bash scripts/check_disk_space.sh"