From 43802259ed5544145ad9d92aa170ea4fd549cd86 Mon Sep 17 00:00:00 2001 From: Adrien Bouvais Date: Sun, 16 Aug 2026 10:33:09 +0200 Subject: [PATCH] Redo builded action to use only shell --- .gitea/workflows/docker-build.yml | 99 +++++++++++-------------------- 1 file changed, 36 insertions(+), 63 deletions(-) diff --git a/.gitea/workflows/docker-build.yml b/.gitea/workflows/docker-build.yml index 197f2bb..1f4ed62 100644 --- a/.gitea/workflows/docker-build.yml +++ b/.gitea/workflows/docker-build.yml @@ -13,91 +13,64 @@ env: jobs: build-and-push: runs-on: ubuntu-latest + steps: - name: Checkout repository uses: actions/checkout@v4 - name: Log in to the Container registry - uses: docker/login-action@v3 - with: - registry: registry.bouvais.lu - username: adrien - password: ${{ secrets.DOCKER_PASSWORD }} + run: | + docker login ${{ env.REGISTRY }} \ + --username adrien \ + --password "${{ secrets.DOCKER_PASSWORD }}" # --- 1. BUILD & TEST BASE IMAGE --- - - name: Extract metadata for Base - id: meta-base - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }} - tags: | - type=raw,value=latest,enable={{is_default_branch}} - type=ref,event=branch - type=sha,format=short - type=semver,pattern={{version}} - - - name: Build Base image (Local) - uses: docker/build-push-action@v5 - with: - context: ./images/base - file: ./images/base/dockerfile - load: true - tags: ${{ steps.meta-base.outputs.tags }} - labels: ${{ steps.meta-base.outputs.labels }} + - name: Build Base image + run: | + docker build \ + -f ./images/base/dockerfile \ + -t ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \ + ./images/base - name: Test Base image run: | docker run --rm \ -v ${{ github.workspace }}/tests:/tests \ - ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ steps.meta-base.outputs.version }} \ + ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \ python3 /tests/base.py + - name: Tag Base image as latest + run: | + docker tag ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \ + ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:latest + - name: Push Base image - uses: docker/build-push-action@v5 - with: - context: ./images/base - file: ./images/base/dockerfile - push: true - tags: ${{ steps.meta-base.outputs.tags }} - labels: ${{ steps.meta-base.outputs.labels }} + run: | + docker push ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} + docker push ${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:latest # --- 2. BUILD & TEST JUPYTER IMAGE --- - - name: Extract metadata for Jupyter - id: meta-jupyter - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }} - tags: | - type=raw,value=latest,enable={{is_default_branch}} - type=ref,event=branch - type=sha,format=short - type=semver,pattern={{version}} - - - name: Build Jupyter image (Local) - uses: docker/build-push-action@v5 - with: - context: ./images/jupyter - file: ./images/jupyter/dockerfile - load: true - build-args: | - BASE_IMAGE=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ steps.meta-base.outputs.version }} - tags: ${{ steps.meta-jupyter.outputs.tags }} - labels: ${{ steps.meta-jupyter.outputs.labels }} + - name: Build Jupyter image + run: | + docker build \ + -f ./images/jupyter/dockerfile \ + --build-arg BASE_IMAGE=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ github.ref_name }} \ + -t ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }} \ + ./images/jupyter - name: Test Jupyter dependencies run: | docker run --rm \ -v ${{ github.workspace }}/tests:/tests \ - ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ steps.meta-base.outputs.version }} \ + ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }} \ python3 /tests/dependencies.py + - name: Tag Jupyter image as latest + run: | + docker tag ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }} \ + ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:latest + - name: Push Jupyter image - uses: docker/build-push-action@v5 - with: - context: ./images/jupyter - file: ./images/jupyter/dockerfile - push: true - build-args: | - BASE_IMAGE=${{ env.REGISTRY }}/${{ env.BASE_IMAGE_NAME }}:${{ steps.meta-base.outputs.version }} - tags: ${{ steps.meta-jupyter.outputs.tags }} - labels: ${{ steps.meta-jupyter.outputs.labels }} + run: | + docker push ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:${{ github.ref_name }} + docker push ${{ env.REGISTRY }}/${{ env.JUPYTER_IMAGE_NAME }}:latest