Skip to content

SSL Config

SSL Config #1

Workflow file for this run

name: SSL Config
on:
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
env:
DOMAIN_NAME: lgr.aldass.dev
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
- name: Install sshpass
run: sudo apt-get install sshpass
- name: Copy nginx config for domain
run: sshpass -v -p ${{ secrets.DROPLET_PASSWORD }} scp -o StrictHostKeyChecking=no ./config/nginx/${{ env.DOMAIN_NAME }}.conf root@${{ vars.DROPLET_IP }}:/etc/nginx/sites-enabled/${{ env.DOMAIN_NAME }}
- name: SSH Config
uses: appleboy/ssh-action@master
with:
host: ${{ vars.DROPLET_IP }}
username: root
password: ${{ secrets.DROPLET_PASSWORD }}
script: |
cd ~
export AUTH_SERVICE_IP=${{ vars.DROPLET_IP }}
# docker compose down
# docker compose pull
# docker compose up -d --build
apt update && sudo apt upgrade -y
apt install ca-certificates curl
apt install certbot python3-certbot-nginx -y
ln -sf /etc/nginx/sites-available/${{ env.DOMAIN_NAME }} /etc/nginx/sites-enabled/
certbot --nginx -d ${{ env.DOMAIN_NAME }}
nginx -t
systemctl restart nginx
certbot renew --dry-run
systemctl status certbot.timer
ufw allow 'Nginx Full'
# ufw delete allow 'Nginx HTTP'