From d1e54bb6e845e32a079c28fc05b49c1184f5c25d Mon Sep 17 00:00:00 2001 From: Amund Tenstad Date: Thu, 5 Dec 2024 08:51:10 +0100 Subject: [PATCH] ci: publish image --- .github/workflows/ci.yml | 17 ++++++----------- Makefile | 3 +++ 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a26408d..a3459e61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,8 @@ on: push: branches: - main - - release-* + tags: + - v* pull_request: {} workflow_dispatch: {} @@ -13,10 +14,6 @@ env: GO_VERSION: '1.23' DOCKER_BUILDX_VERSION: 'v0.18.0' - # Common users. We can't run a step 'if secrets.XXX != ""' but we can run a - # step 'if env.XXX' != ""', so we copy these to succinctly test whether - # credentials have been provided before trying to run steps that need them. - UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} jobs: detect-noop: runs-on: ubuntu-24.04 @@ -191,13 +188,12 @@ jobs: version: ${{ env.DOCKER_BUILDX_VERSION }} install: true - - name: Login to Upbound + - name: Login to Container Registry uses: docker/login-action@v3 - if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != '' with: - registry: xpkg.upbound.io - username: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }} - password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }} + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Checkout uses: actions/checkout@v4 @@ -247,5 +243,4 @@ jobs: path: _output/** - name: Publish Artifacts - if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != '' run: make publish BRANCH_NAME=${GITHUB_REF##*/} diff --git a/Makefile b/Makefile index 1db19973..f7b2832d 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,9 @@ GO111MODULE = on # ==================================================================================== # Setup Images +DOCKER_REGISTRY = ghcr.io/statnett +XPKG_REG_ORGS = $(DOCKER_REGISTRY) +XPKG_REG_ORGS_NO_PROMOTE = $(DOCKER_REGISTRY) IMAGES = provider-cloudian -include build/makelib/imagelight.mk