From 2ac576f59eafd768cedad131dd15e568dc909826 Mon Sep 17 00:00:00 2001 From: Rajpal Chauhan Date: Fri, 26 Jan 2024 11:08:17 -0800 Subject: [PATCH] test Signed-off-by: Rajpal Chauhan --- .github/workflows/main.yaml | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index eb454b68..aca51f36 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -57,15 +57,25 @@ jobs: with: repository: ${{ matrix.GIT_REPO_URL }} - - name: List Directories - run: | - ls -l - echo $service env: service: ${{ matrix.service }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + - name: Pull docker base image and Create Docker file + run: | + docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD + docker pull "${BASE_IMAGE}" + mkdir ${context} && cd ${context} + echo "FROM ${BASE_IMAGE}" > Dockerfile + echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile + if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) + env: + context: ${{ matrix.SOURCE_CONTEXT_DIR }} + BASE_IMAGE: "artifacts.developer.gov.bc.ca/docker-remote/caddy:latest" + REGISTRY_USERNAME: ${{ secrets.USERNAME }} + REGISTRY_PASSWORD: ${{ secrets.PASSWORD }} + - name: Log in to the GHCR uses: docker/login-action@v2 with: @@ -91,19 +101,7 @@ jobs: if: contains(fromJSON('["aries-endorser-agent","aries-endorser-backup","aries-endorser-api","aries-endorser-proxy"]'), matrix.service) env: service: ${{ matrix.service }} - - - name: Pull docker base image and Create Docker file - run: | - docker pull -e REGISTRY_USERNAME -e REGISTRY_PASSWORD "${BASE_IMAGE}" - mkdir ${context} && cd ${context} - echo "FROM ${BASE_IMAGE}" > Dockerfile - echo "RUN chown 1001:root /usr/bin/caddy" >> Dockerfile - if: contains(fromJSON('["aries-endorser-proxy"]'), matrix.service) - env: - context: ${{ matrix.SOURCE_CONTEXT_DIR }} - BASE_IMAGE: "artifacts.developer.gov.bc.ca/docker-remote/caddy:latest" - REGISTRY_USERNAME: ${{ secrets.USERNAME }} - REGISTRY_PASSWORD: ${{ secrets.PASSWORD }} + - name: Build and push Docker image id: docker_build