-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a GitHub action to setup ssh-agent, remove unnecessary pipenv ins…
…tall (#170)
- Loading branch information
Showing
1 changed file
with
14 additions
and
13 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,21 +11,22 @@ jobs: | |
- 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 | ||
|
||
- name: Install Ansible | ||
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 | ||
sudo apt update | ||
sudo apt install -y ansible | ||
- name: Set up SSH agent | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.DISCORD_BOT_DEPLOY_KEY }} | ||
|
||
- 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 | ||
run: ansible-playbook -i ansible/inventory.ini ansible/deploy-playbook.yml --private-key="/home/runner/.ssh/id_rsa" --user=root | ||
env: | ||
ANSIBLE_HOST_KEY_CHECKING: "false" |