Fix CI/CD: remove GHA cache, split build jobs
- Remove cache-from/cache-to that caused timeout errors on Gitea - Split engine and UI builds into parallel jobs - Both images now build independently (one failure won't block the other)
This commit is contained in:
@@ -10,7 +10,6 @@ on:
|
||||
env:
|
||||
REGISTRY: gitea.thefetagroup.com
|
||||
IMAGE_NAME: bnair/cryptobot
|
||||
# Gitea URL for git operations
|
||||
GITEA_URL: https://git.thefetagroup.com
|
||||
|
||||
jobs:
|
||||
@@ -54,7 +53,7 @@ jobs:
|
||||
- name: Run tests
|
||||
run: pytest --cov=tradefinder --cov-report=term-missing
|
||||
|
||||
build-and-push:
|
||||
build-engine:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
@@ -89,8 +88,31 @@ jobs:
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.version.outputs.VERSION }}
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
build-ui:
|
||||
runs-on: ubuntu-latest
|
||||
needs: test
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- name: Checkout code
|
||||
run: |
|
||||
git clone --depth 1 ${{ env.GITEA_URL }}/bnair/CryptoTrading.git .
|
||||
git fetch origin ${{ github.ref_name }} --depth 1
|
||||
git checkout ${{ github.ref_name }}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Extract version from tag
|
||||
id: version
|
||||
run: echo "VERSION=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Login to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
|
||||
- name: Build and push UI image
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -102,5 +124,3 @@ jobs:
|
||||
tags: |
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ui:${{ steps.version.outputs.VERSION }}
|
||||
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-ui:latest
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
Reference in New Issue
Block a user