Skip to content

Release to Production #11

Release to Production

Release to Production #11

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"
ansible-playbook -vvv website-deployment.yaml -i inventory.yaml -e "ssl_private_key=${{ secrets.SSL_PRIVATE_KEY }}" \
-e "ssl_certificate=${{ secrets.SSL_CERTIFICATE }}" -e "ansible_user=playtechnique" --private-key .ssh/digital-ocean-playtechnique