forked from letsgetrusty/live-bootcamp-project
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (43 loc) · 1.57 KB
/
ssl-config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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'