From b7d01e385c141432c608aa401c79dc26aff314e5 Mon Sep 17 00:00:00 2001 From: Jean-Louis Fuchs Date: Mon, 25 Dec 2023 11:09:37 +0100 Subject: [PATCH] login on registry --- .github/workflows/testing.yml | 13 ++++++++++++- Makefile | 13 +++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e6e1f33..cec59de 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -13,14 +13,25 @@ on: jobs: build: runs-on: ubuntu-latest + env: + DOCKER_BUILDKIT: 1 + COMPOSE_DOCKER_CLI_BUILD: 1 steps: - name: Checkout code uses: actions/checkout@v2 + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Run build run: | - make up push + make up + make push || echo "Not able to upload cache. This is not a hard error." - name: Run tests run: | diff --git a/Makefile b/Makefile index 592979c..670a7f1 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,10 @@ .DEFAULT_GOAL := help +COMPOSE_DOCKER_CLI_BUILD = 1 +DOCKER_BUILDKIT = 1 +export COMPOSE_DOCKER_CLI_BUILD +export DOCKER_BUILDKIT + # Help target extracts the double-hash comments from the targets and shows them # in a convenient way. This allows us to easily document the user-facing Make # targets @@ -7,9 +12,13 @@ help: @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort -k 1,1 | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' +.PHONY: pull +pull: ## pull cached container + @docker pull ghcr.io/adfinis/pyaptly/cache:latest + .PHONY: up -up: ## start and build container if needed - #@docker pull ghcr.io/adfinis/pyaptly/cache:latest +up: pull ## start and build container if needed + @env | grep DOCKER @DOCKER_BUILDKIT=1 docker compose up -d --build .PHONY: push