Files
LeDiscord/.gitea/workflows/deploy-develop.yml
EvanChal 857b136124
Some checks failed
Deploy to Development / build-and-deploy (push) Failing after 14s
update ci/cd 9
2025-12-24 00:25:59 +01:00

48 lines
1.8 KiB
YAML

name: Deploy to Development
on:
push:
branches:
- develop
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to Gitea Registry
run: |
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ secrets.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
- name: Build and push backend
run: |
docker build -t ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord:develop-backend ./backend
docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord:develop-backend
- name: Build and push frontend
run: |
echo "Re-logging to registry..."
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ secrets.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
echo "Building frontend image..."
docker build -t ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord:develop-frontend ./frontend
echo "Build successful, pushing with retry..."
for i in {1..3}; do
if docker push ${{ secrets.REGISTRY_URL }}/${{ secrets.REGISTRY_USERNAME }}/lediscord:develop-frontend; then
echo "✅ Push successful!"
exit 0
else
echo "❌ Push attempt $i failed"
if [ $i -lt 3 ]; then
echo "Re-logging and retrying in 3 seconds..."
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login ${{ secrets.REGISTRY_URL }} -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin
sleep 3
fi
fi
done
echo "❌ All push attempts failed"
exit 1