Skip to content

Commit

Permalink
Merge branch 'master' into erin-vigor4
Browse files Browse the repository at this point in the history
  • Loading branch information
erinyoung authored Aug 30, 2024
2 parents e6df4b4 + 213dbc7 commit ddff8de
Show file tree
Hide file tree
Showing 428 changed files with 23,823 additions and 105 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/build-to-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Check Out Repo (+ download Git LFS dependencies) # each job runs in an isolated environment, so need to check out the repo in each job
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
lfs: true

Expand All @@ -61,10 +61,10 @@ jobs:

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers # also need to set up the cache in each job, using the same prefix (here ${{ runner.os }}-buildx) makes it sharable between jobs
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache-${{ inputs.cache }}
key: ${{ runner.os }}-buildx-${{ inputs.cache }}-${{ github.sha }}
Expand All @@ -73,7 +73,7 @@ jobs:
- name: Docker meta
id: meta
uses: docker/metadata-action@v4 # trying this to resolve issues with pushing identical images to quay. info here: https://github.com/docker/build-push-action/issues/452
uses: docker/metadata-action@v5 # trying this to resolve issues with pushing identical images to quay. info here: https://github.com/docker/build-push-action/issues/452
with:
images: |
${{ inputs.repository_name }}/${{ inputs.container_name }}:${{ inputs.tag }}
Expand All @@ -82,13 +82,13 @@ jobs:
quay.io/${{ inputs.repository_name }}/${{ inputs.container_name }}:latest
- name: Login to DockerHub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.docker_username }}
password: ${{ secrets.docker_access_token }}

- name: Login to Quay
uses: docker/login-action@v2
uses: docker/login-action@v3
if: ${{ inputs.push_quay }}
with:
registry: quay.io
Expand All @@ -97,7 +97,7 @@ jobs:

- name: Build and push user-defined tag to DockerHub
id: docker_build_user_defined_tag
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: ${{ inputs.path_to_context }}
file: ${{ inputs.path_to_context }}/${{ inputs.dockerfile_name }}
Expand All @@ -111,7 +111,7 @@ jobs:
- name: Build and push latest tag to DockerHub
id: docker_build_latest_tag
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
if: ${{ inputs.push_latest_tag }}
with:
context: ${{ inputs.path_to_context }}
Expand All @@ -126,7 +126,7 @@ jobs:
- name: Build and push user-defined tag to Quay
id: quay_build_user_defined_tag
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
if: ${{ inputs.push_quay }}
with:
context: ${{ inputs.path_to_context }}
Expand All @@ -141,7 +141,7 @@ jobs:
- name: Build and push latest tag to Quay
id: quay_build_latest_tag
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
if: ${{ inputs.push_quay && inputs.push_latest_tag }}
with:
context: ${{ inputs.path_to_context }}
Expand All @@ -160,4 +160,4 @@ jobs:
mv /tmp/.buildx-cache-${{ inputs.cache }}-new /tmp/.buildx-cache-${{ inputs.cache }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker_build_user_defined_tag.outputs.digest }}
12 changes: 6 additions & 6 deletions .github/workflows/build-to-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Check Out Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache-${{ inputs.cache }}
key: ${{ runner.os }}-buildx-${{ inputs.cache }}-${{ github.sha }}
Expand All @@ -41,7 +41,7 @@ jobs:
- name: Build to test
id: docker_build_to_test
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: ${{ inputs.path_to_context }}
file: ${{ inputs.path_to_context }}/${{ inputs.dockerfile_name }}
Expand All @@ -56,4 +56,4 @@ jobs:
mv /tmp/.buildx-cache-${{ inputs.cache }}-new /tmp/.buildx-cache-${{ inputs.cache }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker_build_to_test.outputs.digest }}
2 changes: 1 addition & 1 deletion .github/workflows/run-singularity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Check out Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Singularity
uses: eWaterCycle/setup-singularity@v7
Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/test-PR-dockerfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
outputs:
json: ${{ steps.files.outputs.added_modified }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- id: files
uses: Ana06/get-changed-files@v2.2.0
uses: Ana06/get-changed-files@v2.3.0
with:
format: 'json'
filter: 'Dockerfile'
Expand Down Expand Up @@ -54,27 +54,27 @@ jobs:
##### --------------------------------------------------------------------------- #####

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Layer check
run: |
#checking layers
warning=''
app_layer=$(grep FROM ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}/Dockerfile | grep "as app")
tst_layer=$(grep FROM ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}/Dockerfile | grep "as test")
app_layer=$(grep FROM ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}/Dockerfile | grep -E "as app|AS app")
tst_layer=$(grep FROM ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}/Dockerfile | grep -E "as test|AS test")
if [ -z "$app_layer" ] ; then echo "FATAL : app layer is missing" ; warning='warning' ; fi
if [ -z "$tst_layer" ] ; then echo "FATAL : test layer is missing" ; warning='warning' ; fi
if [ -n "$warning" ] ; then echo "Please see template for recommended format https://github.com/StaPH-B/docker-builds/blob/master/dockerfile-template/Dockerfile" ; exit 1 ; fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Cache Docker layers
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache-${{ steps.parse.outputs.tool }}
key: ${{ runner.os }}-buildx-${{ steps.parse.outputs.tool }}-${{ github.sha }}
Expand All @@ -83,7 +83,7 @@ jobs:
- name: Build to test
id: docker_build_to_test
uses: docker/build-push-action@v3
uses: docker/build-push-action@v5
with:
context: ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}
file: ./${{ steps.parse.outputs.tool }}/${{ steps.parse.outputs.version }}/Dockerfile
Expand Down Expand Up @@ -123,4 +123,4 @@ jobs:
mv /tmp/.buildx-cache-${{ steps.parse.outputs.tool }}-new /tmp/.buildx-cache-${{ steps.parse.outputs.tool }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
run: echo ${{ steps.docker_build_to_test.outputs.digest }}
89 changes: 89 additions & 0 deletions .github/workflows/update_freyja.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
##### ------------------------------------------------------------------------------------------------ #####
##### This caller workflow tests, builds, and pushes the image to Docker Hub and Quay using the most #####
##### recent version of Freyja and downloading the most recent variant information. #####
##### It takes no manual input. #####
##### ------------------------------------------------------------------------------------------------ #####

name: Update Freyja

on:
workflow_dispatch:
schedule:
- cron: '30 7 1 * *'

run-name: Updating Freyja

jobs:
update:
runs-on: ubuntu-latest
steps:
- name: pull repo
uses: actions/checkout@v4

- name: set freyja version
id: latest_version
run: |
version=1.5.1
echo "version=$version" >> $GITHUB_OUTPUT
file=freyja/$version/Dockerfile
ls $file
echo "file=$file" >> $GITHUB_OUTPUT
- name: set up docker buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: build to test
id: docker_build_to_test
uses: docker/build-push-action@v5
with:
file: ${{ steps.latest_version.outputs.file }}
target: test
load: true
push: false
tags: freyja:update

- name: get freyja database version
id: db_version
run: |
docker run freyja:update freyja demix --version
version=$(docker run freyja:update freyja demix --version | grep . | grep -v Barcode | head -n 1)
echo "the latest version is $version"
echo "version=$version" >> $GITHUB_OUTPUT
- name: Get current date
id: date
run: |
date=$(date '+%Y-%m-%d')
echo "the date is $date"
echo "date=$date" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to Quay
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Build and push Dockerfile
id: docker_build_and_push
uses: docker/build-push-action@v5
with:
file: ${{ steps.latest_version.outputs.file }}
target: app
push: true
tags: |
staphb/freyja:${{ steps.latest_version.outputs.version }}-${{ steps.db_version.outputs.version }}-${{ steps.date.outputs.date }}
staphb/freyja:latest
quay.io/staphb/freyja:${{ steps.latest_version.outputs.version }}-${{ steps.db_version.outputs.version }}-${{ steps.date.outputs.date }}
quay.io/staphb/freyja:latest
- name: Image digest
run: echo ${{ steps.docker_build_user_defined_tag.outputs.digest }}
87 changes: 87 additions & 0 deletions .github/workflows/update_mlst.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
##### ------------------------------------------------------------------------------------------------ #####
##### This caller workflow tests, builds, and pushes the image to Docker Hub and Quay using the most #####
##### recent version of MLST and downloads the current MLST schemes. #####
##### It takes no manual input. #####
##### ------------------------------------------------------------------------------------------------ #####

name: Update MLST

on:
workflow_dispatch:
schedule:
- cron: '30 7 1 * *'

run-name: Updating MLST

jobs:
update:
runs-on: ubuntu-latest
steps:

- name: pull repo
uses: actions/checkout@v4

- name: set mlst version
id: latest_version
run: |
version=2.23.0
echo "version=$version" >> $GITHUB_OUTPUT
file=mlst/2.23.0-2024-03/Dockerfile
ls $file
echo "file=$file" >> $GITHUB_OUTPUT
- name: set up docker buildx
id: buildx
uses: docker/setup-buildx-action@v3

- name: build to test
id: docker_build_to_test
uses: docker/build-push-action@v5
with:
context: mlst/${{ steps.latest_version.outputs.version }}
target: test
load: true
push: false
tags: mlst:update

- name: Get current date
id: date
run: |
date=$(date '+%Y-%m-%d')
echo "the date is $date"
echo "date=$date" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Login to Quay
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}

- name: Build and push user-defined tag to DockerHub
id: docker_build_user_defined_tag
uses: docker/build-push-action@v5
with:
file: ${{ steps.latest_version.outputs.file }}
target: app
push: true
tags: staphb/mlst:${{ steps.latest_version.outputs.version }}-${{ steps.date.outputs.date }}

- name: Build and push to Quay
id: build
uses: docker/build-push-action@v5
with:
file: ${{ steps.latest_version.outputs.file }}
target: app
push: true
tags: quay.io/staphb/mlst:${{ steps.latest_version.outputs.version }}-${{ steps.date.outputs.date }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
Loading

0 comments on commit ddff8de

Please sign in to comment.