-
Notifications
You must be signed in to change notification settings - Fork 119
87 lines (72 loc) · 2.74 KB
/
update_mlst.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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 }}