Release to Production #20
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: Release to Production | |
on: | |
workflow_call: | |
workflow_dispatch: | |
jobs: | |
ssh-to-digiocean-and-upgrade: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Ansible | |
run: sudo apt-get update && sudo apt-get install -y ansible | |
- name: Run ansible playbook installing docker | |
run: | | |
cd ansible | |
mkdir -p .ssh | |
echo '${{ secrets.DIGITAL_OCEAN_ROOT_SSH }}' > ".ssh/digital-ocean-root" | |
chmod 600 ".ssh/digital-ocean-root" | |
ansible-playbook install-upgrade-docker.yaml -i inventory.yaml -e "ansible_user=root" --private-key ".ssh/digital-ocean-root" | |
- name: Run Ansible Playbook starting container | |
run: | | |
cd ansible | |
mkdir -p .ssh | |
echo '${{ secrets.DIGITAL_OCEAN_PLAYTECHNIQUE }}' > ".ssh/digital-ocean-playtechnique" | |
chmod 600 ".ssh/digital-ocean-playtechnique" #to stop the ssh permissions squawking at me | |
ansible-playbook -vvv website-deployment.yaml -i inventory.yaml -e "ansible_user=playtechnique" --private-key .ssh/digital-ocean-playtechnique |