From e6f79ce37d1b1d5fb57a06b0dc07650e7f8b080a Mon Sep 17 00:00:00 2001 From: Marco Vermeulen Date: Sat, 3 Feb 2024 13:08:38 +0000 Subject: [PATCH] Release to DO container registry --- .github/workflows/release.yml | 21 ++++++++++++++------- build.sbt | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9b55fff4..11adaee5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,7 +6,7 @@ on: jobs: build: - name: "Stable Release" + name: "Release" runs-on: ubuntu-latest environment: production services: @@ -15,14 +15,21 @@ jobs: ports: - 27017:27017 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Log in to Docker Hub - run: | - docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - - uses: oleksiyrudenko/gha-git-credentials@v2.1 + - name: Install doctl + uses: digitalocean/action-doctl@v2 with: - token: '${{ secrets.GITHUB_TOKEN }}' + token: ${{ secrets.DIGITALOCEAN_TOKEN }} + - name: Log in to DigitalOcean Docker Registry + run: | + doctl registry login - name: Release run: ./sbt "release with-defaults" + # - name: Push image to DO registry + # run: | + # version=$(sbt version | tail -n 1 | awk -F ' ' '{print $2}') + # docker push registry.digitalocean.com/sdkman/sdkman-website:$version + # docker push registry.digitalocean.com/sdkman/sdkman-website:latest + diff --git a/build.sbt b/build.sbt index 1d9da3f4..ff25b8d3 100644 --- a/build.sbt +++ b/build.sbt @@ -6,7 +6,7 @@ name := """sdkman-website""" organization := "io.sdkman" -Docker / packageName := "sdkman/sdkman-website" +Docker / packageName := "registry.digitalocean.com/sdkman/sdkman-website" dockerBaseImage := "openjdk:11"