From 362ed8e34614699e71066e95979baea55e8a2810 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 4 Nov 2025 19:02:56 +0100 Subject: [PATCH] fix build and bush be image --- .gitea/workflows/full-latest.yaml | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/.gitea/workflows/full-latest.yaml b/.gitea/workflows/full-latest.yaml index 9306d99..98d84dd 100644 --- a/.gitea/workflows/full-latest.yaml +++ b/.gitea/workflows/full-latest.yaml @@ -1,5 +1,5 @@ -name: Gitea Actions Demo 2 -run-name: ${{ gitea.actor }} is testing out Gitea Actions +name: Full Build and Docker Push Workflow +run-name: ${{ gitea.actor }} is running a full build and Docker push workflow on: push: @@ -26,10 +26,6 @@ jobs: - name: Clone the repository uses: actions/checkout@v4 - #with: - #repository: ${{ gitea.repository }} - #token: ${{ secrets.ACCESS_TOKEN }} - #fetch-depth: 0 - name: Set up Java uses: actions/setup-java@v5 @@ -47,8 +43,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - #NOTE: Images must follow this naming convention: - {registry}/{owner}/{image} - #Build Docker image + #Build Docker image - Images must follow this naming convention: - {registry}/{owner}/{image} - name: Build Docker image env: GITEA_REGISTRY_URL: ${{ vars.REGISTRY_URL }} @@ -62,26 +57,18 @@ jobs: - name: Build and push Docker image using Buildx env: GITEA_REGISTRY_URL: ${{ vars.REGISTRY_URL }} - #GITEA_REGISTRY_URL: ${{ secrets.REGISTRY_URL }} IMAGE_NAME: my-app-backend APP_VERSION: v1.0.0 - #IMAGE_NAME: ${{ vars.IMAGE_NAME }} OWNER: ${{ gitea.actor }} + LOGIN_TOKEN: ${{ secrets.LOGIN_TOKEN }} run: | - #docker buildx build --no-cache -t eberen/services:backend-$APP_VERSION . docker buildx build --platform linux/amd64 -t $GITEA_REGISTRY_URL/$OWNER/$IMAGE_NAME:$APP_VERSION . #docker buildx build \ # --platform linux/amd64 \ - # -t $IMAGE_NAME:latest \ - # -t $GITEA_REGISTRY_URL/$OWNER/$IMAGE_NAME:latest \ - # #-t ${{ secrets.GITEA_REGISTRY_URL }}/$OWNER/$IMAGE_NAME:latest \ + # #-t $GITEA_REGISTRY_URL/$OWNER/$IMAGE_NAME:latest \ # #--push \ # . - - name: List Docker images - run: | - docker images - - name: Push Docker image to Gitea Registry env: GITEA_USERNAME: ${{ gitea.actor }} @@ -91,9 +78,11 @@ jobs: # Login securely echo "$LOGIN_TOKEN" | docker login $GITEA_REGISTRY_URL --username $GITEA_USERNAME --password-stdin docker push $GITEA_REGISTRY_URL/$GITEA_USERNAME/my-app:latest - docker push $GITEA_REGISTRY_URL/$GITEA_USERNAME/my-app:latest docker logout $GITEA_REGISTRY_URL + + - name: Cleanup + run: | + docker images -a docker system prune -f - pwd - cd && ls -la + echo "Cleanup done."