From 2800421e8daa1217a1405d4528e8db563b7ccf64 Mon Sep 17 00:00:00 2001 From: Amir Raminfar Date: Wed, 12 Apr 2023 13:14:15 -0700 Subject: [PATCH] ci: use docker bake instead (#2119) * Updates to bake instead * Removes buildx from compose * Cleans up build again * Removes load * More clean up * Tries to use bake correctly * ci: use bake plugin again --- .github/workflows/test.yml | 35 +++++++++-------------------------- 1 file changed, 9 insertions(+), 26 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 626bea17..cedad012 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,32 +65,15 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v3 - with: - fetch-depth: 2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2.5.0 - - name: Login to DockerHub - if: ${{ !github.event.repository.fork && !github.event.pull_request.head.repo.fork }} - uses: docker/login-action@v2.1.0 + uses: docker/setup-buildx-action@v2 + - name: Build + uses: docker/bake-action@v2 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Build images - run: COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f e2e/docker-compose.yml build --build-arg BUILDKIT_INLINE_CACHE=1 - - name: Push images - if: ${{ !github.event.repository.fork && !github.event.pull_request.head.repo.fork }} - run: COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f e2e/docker-compose.yml push - - name: Set commit message for push - if: github.event_name == 'push' - run: | - echo "GIT_LOG_MESSAGE<> $GITHUB_ENV - git log -1 --pretty=%B ${GITHUB_SHA} >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV - - name: Set commit message for pull request - if: github.event_name == 'pull_request' - run: | - echo "GIT_LOG_MESSAGE<> $GITHUB_ENV - git log -1 --pretty=%B ${{github.event.pull_request.head.sha}} >> $GITHUB_ENV - echo 'EOF' >> $GITHUB_ENV + workdir: ./e2e + load: true + set: | + *.cache-from=type=gha + *.cache-to=type=gha,mode=max - name: Run tests - run: COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker compose -f e2e/docker-compose.yml up --build --force-recreate --exit-code-from cypress + run: docker compose -f e2e/docker-compose.yml up --exit-code-from cypress