new cid/cd
Some checks are pending
Deploy to Development / build-and-deploy (push) Waiting to run

This commit is contained in:
EvanChal
2025-12-23 19:19:51 +01:00
parent e916dd7cd0
commit 8b48a8de62
2 changed files with 165 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
name: Deploy to Development
on:
push:
branches:
- develop
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Gitea Container Registry
uses: docker/login-action@v2
with:
registry: ${{ secrets.GITEA_REGISTRY }}
username: ${{ secrets.GITEA_USERNAME }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Build and push backend image
uses: docker/build-push-action@v4
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: ${{ secrets.GITEA_REGISTRY }}/${{ secrets.GITEA_USERNAME }}/lediscord-backend:develop
cache-from: type=registry,ref=${{ secrets.GITEA_REGISTRY }}/${{ secrets.GITEA_USERNAME }}/lediscord-backend:develop
cache-to: type=inline
- name: Build and push frontend image
uses: docker/build-push-action@v4
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: ${{ secrets.GITEA_REGISTRY }}/${{ secrets.GITEA_USERNAME }}/lediscord-frontend:develop
cache-from: type=registry,ref=${{ secrets.GITEA_REGISTRY }}/${{ secrets.GITEA_USERNAME }}/lediscord-frontend:develop
cache-to: type=inline
- name: Deploy to development server
uses: appleboy/ssh-action@v0.1.7
with:
host: ${{ secrets.DEV_HOST }}
username: ${{ secrets.DEV_USERNAME }}
key: ${{ secrets.DEV_SSH_KEY }}
script: |
cd /path/to/lediscord
docker-compose pull
docker-compose up -d --build
docker-compose restart