From a4d83af2dffda6b0137cd75fc4d82486330aa1eb Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Fri, 23 Aug 2024 14:08:43 -0700 Subject: [PATCH 1/7] add link to source of workflow --- .github/workflows/build_and_publish_image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_and_publish_image.yml b/.github/workflows/build_and_publish_image.yml index 79fcb5c..8d8f280 100644 --- a/.github/workflows/build_and_publish_image.yml +++ b/.github/workflows/build_and_publish_image.yml @@ -1,3 +1,4 @@ +# https://docs.github.com/en/actions/use-cases-and-examples/publishing-packages/publishing-docker-images name: Build and Publish Image # Configures this workflow to run every time a change is pushed to the branch called `release`. From 1cb52d07a4dfb9523267901d5a8f28347ed1e595 Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Mon, 26 Aug 2024 11:23:02 -0700 Subject: [PATCH 2/7] Use latest releases of actions --- .github/workflows/build_and_publish_image.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_and_publish_image.yml b/.github/workflows/build_and_publish_image.yml index 8d8f280..430be69 100644 --- a/.github/workflows/build_and_publish_image.yml +++ b/.github/workflows/build_and_publish_image.yml @@ -9,7 +9,7 @@ on: # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. env: REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} + IMAGE_NAME: bccdc-phl/auspice jobs: build-and-publish-image: @@ -26,7 +26,7 @@ jobs: # Uses the `docker/login-action` action to log in to the Container registry registry using the account and password that # will publish the packages. Once published, the packages are scoped to the account defined here. - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} @@ -36,7 +36,7 @@ jobs: # a subsequent step. The `images` value provides the base name for the tags and labels. - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + uses: docker/metadata-action@v5 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. @@ -45,13 +45,12 @@ jobs: # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. - name: Build and push Docker image id: push - uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + uses: docker/build-push-action@v6 with: context: . push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. # It increases supply chain security for people who consume the image. For more information, # see "[Using artifact attestations to establish provenance for builds](https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds)." From 8ec9e81e0e8f955fbf256d27edfb95601bfbf899 Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Mon, 26 Aug 2024 11:30:58 -0700 Subject: [PATCH 3/7] Use build ARG for auspice version --- Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e79ec09..52dcd54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM node:16-slim +ARG AUSPICE_VERSION="v2.56.1" + RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ git @@ -8,7 +10,7 @@ COPY scripts /scripts WORKDIR /nextstrain/auspice -RUN /scripts/download-repo https://github.com/BCCDC-PHL/auspice release . \ +RUN /scripts/download-repo https://github.com/BCCDC-PHL/auspice ${AUSPICE_VERSION} . \ && npm install --omit dev . && npm link ENV HOST=0.0.0.0 From ef4a0ba282866744d53fde78f1a058eaf9193f5a Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Mon, 26 Aug 2024 11:31:46 -0700 Subject: [PATCH 4/7] Merge release to main (#3) * Empty-Commit * add link to source of workflow (#1) * Use latest releases of actions (#2) * add link to source of workflow * Use latest releases of actions From 483e375ddc31e7f2c615134d43654ada425d518f Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Mon, 26 Aug 2024 11:32:59 -0700 Subject: [PATCH 5/7] Release (#5) * Empty-Commit * add link to source of workflow (#1) * Use latest releases of actions (#2) * add link to source of workflow * Use latest releases of actions * release (#4) * add link to source of workflow * Use latest releases of actions * Use build ARG for auspice version * Merge release to main (#3) * Empty-Commit * add link to source of workflow (#1) * Use latest releases of actions (#2) * add link to source of workflow * Use latest releases of actions From e2654057660d8b50b6a7190fd5c0ee205f53ff1e Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Mon, 26 Aug 2024 11:42:07 -0700 Subject: [PATCH 6/7] Add instructions for pulling container --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 1b44820..a885441 100644 --- a/README.md +++ b/README.md @@ -38,3 +38,21 @@ docker run -d\ ``` The application should be available on [http://localhost:4000](http://localhost:4000). + +## Pulling the Container from GitHub Container Registry + +Pulling the container from the [GitHub Container Registry](https://github.com/features/packages) (aka "GitHub Packages") requires a GitHub account and a +[personal access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens). + +First store the personal access token to an environment variable `CR_PAT`, then login to the container registry as follows: + +``` +export CR_PAT="ghp_a68fgN8..." +echo $CR_PAT | docker login ghcr.io -u --password-stdin +``` + +The container can then be pulled as follows: + +``` +docker pull ghcr.io/bccdc-phl/auspice:release +``` \ No newline at end of file From 5118474c9c831014b36b5e40d705e97b08c9467b Mon Sep 17 00:00:00 2001 From: Dan Fornika Date: Wed, 23 Oct 2024 15:49:43 -0700 Subject: [PATCH 7/7] bump version --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 52dcd54..cca5965 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ FROM node:16-slim -ARG AUSPICE_VERSION="v2.56.1" +ARG AUSPICE_VERSION="v2.59.1" RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates \ @@ -11,7 +11,8 @@ COPY scripts /scripts WORKDIR /nextstrain/auspice RUN /scripts/download-repo https://github.com/BCCDC-PHL/auspice ${AUSPICE_VERSION} . \ - && npm install --omit dev . && npm link + && npm install --omit dev . \ + && npm link ENV HOST=0.0.0.0