Skip to content

Update hosts and deployment action file #12

Update hosts and deployment action file

Update hosts and deployment action file #12

Workflow file for this run

# Ansible deployment command
# ansible-playbook -i ansible/hosts ansible/deploy.yaml
name: Deploy Application
on:
push:
branches:
- deploy
# - pull_request:
# types:
# - opened
# - reopened
# branches:
# - develop
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup SSH Keys
run: |
mkdir -p ~/.ssh
echo "${{ secrets.VPS_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan -t rsa ${{ secrets.VPS_IP }} >> ~/.ssh/known_hosts
- name: Deploy using Ansible
run: ansible-playbook -i ansible/hosts --private-key ~/.ssh/id_rsa -u optimus ansible/deploy.yaml