From 6f0700ce9d4a9834ecff44e085e15216913ddee8 Mon Sep 17 00:00:00 2001 From: Michael Foley Date: Thu, 21 Sep 2023 18:51:32 +1000 Subject: [PATCH] refactor: migrate to ghcr for hosting (#77) --- .github/workflows/build.yml | 22 +++++++++++----------- README.md | 21 +++++---------------- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f6acdaa..bc65160 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,10 +8,11 @@ on: - '[0-9]+.[0-9]+.[0-9]+' pull_request: - # Run a weekly update to get the latest packages workflow_dispatch: - schedule: - - cron: 0 9 * * * + +permissions: + contents: read + packages: write jobs: @@ -40,26 +41,25 @@ jobs: id: meta uses: docker/metadata-action@v3 with: - images: hamletio/hamlet + images: | + ghcr.io/${{github.repository}} flavor: | latest=auto suffix=${{ matrix.suffix }},onlatest=true tags: | type=edge,branch=master type=semver,pattern={{version}} - type=schedule,pattern=nightly - type=schedule,pattern=schedule-{{date 'YYYYMMDD'}} type=sha - name: Set up Docker uses: docker/setup-buildx-action@v1 - - name: Login Dockerhub - uses: docker/login-action@v1 + - name: Login to GHCR + uses: docker/login-action@v3 with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} - if: ${{ github.event_name == 'scheduled' || startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' }} + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} - name: Push Release uses: docker/build-push-action@v2 diff --git a/README.md b/README.md index 7c96377..d537499 100644 --- a/README.md +++ b/README.md @@ -4,40 +4,29 @@ Ths repo contains the docker image build process for the Hamlet Deploy CI Contai For more information on hamlet see https://docs.hamlet.io -## Shim engines - -The docker container supports a shim style engine that provides a fixed set of directory locations symlinked to the current default engine. -This is used when you are calling the bash executor commands directly instead of using the hamlet cli commands and would like to manage the engine version through the cli. - -The standard engine environment variables are set within the docker container to support this as soon as you start the container up. - -To support the migration from using the local java installation to a bundled installation there are two shim modes available, the bundled and the local shims. - -If you are planning on using a version of hamlet before 8.5.0 make sure to set the shim mode to the local shim. For any versions above 8.5.0 you can leave the mode as the bundled mode. - -To configure the mode set the environment variable `HAMLET_ENGINE_SHIM_MODE` to either `local` or `bundled` as part of the containers startup environment variables - ## Image Variants ### Base -#### ```hamletio/hamlet:``` +#### ```ghcr.io/hamlet-io/docker-hamlet:``` This is our base docker image which includes all the requirements for running hamlet and build tooling. This image can be used as a general purpose CI image The image also includes common application runtimes for application builds - python (pyenv for version management) - node (nodenv for version management) +- java (jenv for version management) +- ruby (rbenv for version management) ### Pipeline Agents The Pipeline agent images are extensions of the base images with support for running as a pipeline agent -#### ```hamletio/hamlet:-jenkins-``` +#### ```ghcr.io/hamlet-io/docker-hamlet:-jenkins``` This image extends the base image with the Jenkins JNLP based remoting agent installed and configured to run as the entrypoint. This is designed to work with container-based cloud agents. -#### ```hamletio/hamlet:-azpipeline-``` +#### ```ghcr.io/hamlet-io/docker-hamlet:-azpipeline``` This image extends the base image with the Azure Pipelines agent, this allows for the use of container based agents for local builds