Skip to content

Run Certbot and restart Nginx #8

Run Certbot and restart Nginx

Run Certbot and restart Nginx #8

Workflow file for this run

name: Run Certbot and restart Nginx
on:
workflow_dispatch:
jobs:
deploy:
name: Run Certbot to obtain SSL certificate
runs-on: ubuntu-latest
environment: Production
steps:
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: SSH into droplet and run certbot
run: |
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} << 'EOF'
set -e
cd ~/app
export DOMAIN_NAME=${{ vars.DOMAIN_NAME }}
export EMAIL_ADDRESS=${{ vars.EMAIL_ADDRESS }}
docker compose --profile manual run certbot || true
docker exec nginx nginx -s reload
EOF