update ci/cd
Some checks failed
Deploy to Development / build-and-deploy (push) Failing after 9s

This commit is contained in:
EvanChal
2025-12-23 23:25:15 +01:00
parent 8b48a8de62
commit ae3821a68e
2 changed files with 22 additions and 52 deletions

View File

@@ -8,49 +8,19 @@ on:
jobs: jobs:
build-and-deploy: build-and-deploy:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: Set up Docker Buildx - name: Login to Gitea Registry
uses: docker/setup-buildx-action@v2 run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ secrets.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
- name: Login to Gitea Container Registry - name: Build and push backend
uses: docker/login-action@v2 run: |
with: docker build -t ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord-backend:develop ./backend
registry: ${{ secrets.GITEA_REGISTRY }} docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord-backend:develop
username: ${{ secrets.GITEA_USERNAME }}
password: ${{ secrets.GITEA_TOKEN }} - name: Build and push frontend
run: |
- name: Build and push backend image docker build -t ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord-frontend:develop ./frontend
uses: docker/build-push-action@v4 docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord-frontend:develop
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

View File

@@ -80,9 +80,9 @@ jobs:
- name: Login to Gitea Container Registry - name: Login to Gitea Container Registry
uses: docker/login-action@v2 uses: docker/login-action@v2
with: with:
registry: ${{ secrets.GITEA_REGISTRY }} registry: ${{ secrets.REGISTRY_URL }}
username: ${{ secrets.GITEA_USERNAME }} username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.GITEA_TOKEN }} password: ${{ secrets.REGISTRY_TOKEN }}
- name: Build and push backend image - name: Build and push backend image
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
@@ -91,9 +91,9 @@ jobs:
file: ./backend/Dockerfile file: ./backend/Dockerfile
push: true push: true
tags: | tags: |
${{ secrets.GITEA_REGISTRY }}/${{ secrets.GITEA_USERNAME }}/lediscord-backend:prod ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord-backend:prod
${{ secrets.GITEA_REGISTRY }}/${{ secrets.GITEA_USERNAME }}/lediscord-backend:latest ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord-backend:latest
cache-from: type=registry,ref=${{ secrets.GITEA_REGISTRY }}/${{ secrets.GITEA_USERNAME }}/lediscord-backend:prod cache-from: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord-backend:prod
cache-to: type=inline cache-to: type=inline
- name: Build and push frontend image - name: Build and push frontend image
@@ -103,7 +103,7 @@ jobs:
file: ./frontend/Dockerfile file: ./frontend/Dockerfile
push: true push: true
tags: | tags: |
${{ secrets.GITEA_REGISTRY }}/${{ secrets.GITEA_USERNAME }}/lediscord-frontend:prod ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord-frontend:prod
${{ secrets.GITEA_REGISTRY }}/${{ secrets.GITEA_USERNAME }}/lediscord-frontend:latest ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord-frontend:latest
cache-from: type=registry,ref=${{ secrets.GITEA_REGISTRY }}/${{ secrets.GITEA_USERNAME }}/lediscord-frontend:prod cache-from: type=registry,ref=${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord-frontend:prod
cache-to: type=inline cache-to: type=inline