Deploy to server #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 to server | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11.4' | |
- name: Install pipenv | |
run: curl https://raw.githubusercontent.com/pypa/pipenv/master/get-pipenv.py | python | |
- run: pipenv install --dev | |
- name: Setup ssh | |
shell: bash | |
run: | | |
service ssh status | |
eval `ssh-agent -s` | |
mkdir /home/runner/.ssh | |
touch /home/runner/.ssh/id_rsa | |
chmod 700 /home/runner/.ssh/id_rsa | |
echo -e "${{secrets.ANSIBLE_DEPLOY_SSH_KEY}}" > /home/runner/.ssh/id_rsa | |
ssh-keyscan -t ed25519 ${{secrets.BOT_HOST_IP}} >> /home/runner/.ssh/known_hosts | |
- name: Deploy EuroPythonBot with ansible | |
run: pipenv run ansible-playbook -i ansible/inventory.ini ansible/deploy-playbook.yml --private-key="/home/runner/.ssh/id_rsa" --user=root |