name: Deploy to Production, build images and push to Gitea Registry on: push: branches: - prod # Trigger deployment only on pushes to main jobs: 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: Log in to Gitea Container Registry uses: docker/login-action@v2 with: registry: git.vinylnostalgia.com:5000 # IMPORTANT: Verify this is your Gitea registry URL (e.g., git.vinylnostalgia.com or with a different port). username: ${{ gitea.actor }} # Uses the user that triggered the action. You can replace with 'mo' if needed. password: ${{ secrets.GITEA_TOKEN }} # IMPORTANT: Create a Gitea repository secret named GITEA_TOKEN with your password or access token. - name: Build and push backend image to Gitea Registry uses: docker/build-push-action@v4 with: context: ./be file: ./be/Dockerfile.prod push: true tags: git.vinylnostalgia.com:5000/${{ gitea.repository_owner }}/${{ gitea.repository_name }}-backend:latest # IMPORTANT: Verify registry URL matches the login step. # Ensure gitea.repository_owner and gitea.repository_name resolve as expected for your image path. - name: Build and push frontend image to Gitea Registry uses: docker/build-push-action@v4 with: context: ./fe file: ./fe/Dockerfile.prod push: true tags: git.vinylnostalgia.com:5000/${{ gitea.repository_owner }}/${{ gitea.repository_name }}-frontend:latest # IMPORTANT: Verify registry URL matches the login step. # Ensure gitea.repository_owner and gitea.repository_name resolve as expected for your image path. build-args: | VITE_API_URL=${{ secrets.VITE_API_URL }} VITE_SENTRY_DSN=${{ secrets.VITE_SENTRY_DSN }}