From a644882ae81ff0ea19f9b3e9d796f461c9153f5c 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 | 12 +++++++++++- Makefile | 13 +++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index e6e1f33..a2e3b48 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -13,14 +13,24 @@ 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 pull push - 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