From bd53890795fd5e3726062261d5c193521b1c0e6c Mon Sep 17 00:00:00 2001 From: staffadmin Date: Sat, 18 Nov 2023 19:51:27 +0100 Subject: [PATCH] fff --- .gitea/workflows/build_image.yaml | 44 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml index 4c3154d..982a95d 100644 --- a/.gitea/workflows/build_image.yaml +++ b/.gitea/workflows/build_image.yaml @@ -15,15 +15,9 @@ jobs: steps: # TEST - - name: Print vars test - run: echo "${{ var.REGISTRY_DOCKER }} ${{ vars.REGISTRY_DOCKER }} ${{ variables.REGISTRY_DOCKER }} ${{ REGISTRY_DOCKER }}" - - name: Print vars test - run: echo "${{ REGISTRY_DOCKER }} ${{ env.REGISTRY_DOCKER }}" - name: Print Gitea runner tag run: echo ${{ env.GITEA_RUNNER_TAG }} - - name: Print Gitea runner tag - variables: - TEST: registry.jingoh.fr + - name: Print vars repo test run: echo ${{ vars.REGISTRY_DOCKER }} # CLONE - name: Checkout private tools @@ -48,7 +42,7 @@ jobs: # BUILD & PUSH docker image - name: Build the Docker image - run: docker build . --file Dockerfile --tag test:$(date +%s) + run: docker build . --file Dockerfile --tag ${{ vars.DOCKER_IMAGE_NAME }}:$(date +%s) # - name: Login to registry # run: docker login -u "test:test" https://registry.jingoh.fr @@ -65,34 +59,38 @@ jobs: # Login against a Docker registry except on PR # https://github.com/docker/login-action - - name: Log into registry ${{ env.REGISTRY_DOCKER }} - env: - REGISTRY_DOCKER: registry.jingoh.fr + - name: Log into registry ${{ vars.REGISTRY_DOCKER }} + # env: + # REGISTRY_DOCKER: registry.jingoh.fr uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 with: - registry: ${{ env.REGISTRY_DOCKER }} + registry: ${{ vars.REGISTRY_DOCKER }} username: ${{ secrets.REGISTRY_DOCKER_USER }} password: ${{ secrets.REGISTRY_DOCKER_PASS }} + - run: docker images + # Extract metadata (tags, labels) for Docker # https://github.com/docker/metadata-action - name: Extract Docker metadata id: meta uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 with: - images: ${{ env.REGISTRY_DOCKER }}/${{ env.DOCKER_IMAGE_NAME }} + images: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_NAME }} + + - run: docker images # Build and push Docker image with Buildx (don't push on PR) # https://github.com/docker/build-push-action - - name: Build and push Docker image - id: build-and-push - uses: docker/build-push-action@master - with: - context: "{{defaultContext}}:src" - #push: ${{ github.event_name != 'pull_request' }} # Don't push on PR - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + # - name: Build and push Docker image + # id: build-and-push + # uses: docker/build-push-action@master + # with: + # context: "{{defaultContext}}:src" + # #push: ${{ github.event_name != 'pull_request' }} # Don't push on PR + # tags: ${{ steps.meta.outputs.tags }} + # labels: ${{ steps.meta.outputs.labels }} + # cache-from: type=gha + # cache-to: type=gha,mode=max # - run: echo "🐧 This job was running on a ${{ runner.os }} server hosted by Gitea!" \ No newline at end of file