diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 05209ce..2428e47 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,19 +18,17 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - # - name: Login to Docker Hub - # uses: docker/login-action@v3 - # with: - # username: ${{ secrets.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Build and push run: | export VERSION=$(cat Dockerfile | grep 'wg_go_tag=' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') - docker buildx create \ - --name container \ - --driver=docker-container + make buildx_container TAG=$VERSION make build_and_push TAG=latest make build_and_push diff --git a/Makefile b/Makefile index 734ba77..d3ce5ac 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,12 @@ -.PHONY: build_and_push +.PHONY: builx_container build_and_push DOCKER_REGISTRY ?= masipcat/wireguard-go +builx_container: + docker buildx create \ + --name container \ + --driver=docker-container + build_and_push: docker buildx build \ --tag ${DOCKER_REGISTRY}:${TAG} \