plh97 Ansible Deploy π #11
This file contains hidden or 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: Ansible deploy | |
| run-name: ${{ github.actor }} Ansible Deploy π | |
| on: | |
| push: | |
| branches: | |
| - "main" | |
| jobs: | |
| Ansible-Actions: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v3 | |
| - name: Install SSH Key | |
| uses: shimataro/ssh-key-action@v2 | |
| with: | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| name: java-learn.pem # Write the key to /home/runner/.ssh/java-learn.pem | |
| known_hosts: "just-a-placeholder-so-we-dont-get-errors" | |
| config: | | |
| Host vultr | |
| HostName 45.77.39.167 | |
| CheckHostIP no | |
| Port 22 | |
| User root | |
| - name: Adding Known Hosts | |
| run: ssh-keyscan -H 45.77.39.167 >> ~/.ssh/known_hosts | |
| - name: run ansible | |
| run: | | |
| cd ansible && ansible-playbook cicd-vultr.yml |