Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sprint 02 #1

Merged
merged 3 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,25 @@ jobs:
profile: minimal
toolchain: stable

- name: Install cargo-nextest
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-nextest
args: --locked
# Uncomment the following line if you'd like to stay on the 0.9 series
# version: 0.9

- name: Build and test app-service code
working-directory: ./app-service
run: |
cargo build --verbose
cargo test --verbose
cargo nextest run

- name: Build and test auth-service code
working-directory: ./auth-service
run: |
cargo build --verbose
cargo test --verbose
cargo nextest run

# Set up Docker Buildx for multi-platform builds
- name: Set up Docker Buildx
Expand Down Expand Up @@ -98,4 +106,4 @@ jobs:
export AUTH_SERVICE_IP=${{ vars.DROPLET_IP }}
docker compose down
docker compose pull
docker compose up -d
docker compose up -d --build
52 changes: 52 additions & 0 deletions .github/workflows/ssl-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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'
37 changes: 17 additions & 20 deletions app-service/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading