|
1 | 1 | name: Build and publish pangolin docker image for master
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - schedule: |
5 |
| - - cron: '0 0 * * *' |
6 |
| - push: |
| 4 | + schedule: |
| 5 | + - cron: "0 0 * * *" |
| 6 | + push: |
7 | 7 | branches:
|
8 | 8 | - master
|
9 | 9 |
|
10 | 10 | jobs:
|
11 | 11 | get-version:
|
12 | 12 | runs-on: ubuntu-latest
|
13 | 13 | steps:
|
14 |
| - - uses: actions/checkout@v2 |
15 |
| - - name: Get current date |
16 |
| - id: date |
17 |
| - run: echo "::set-output name=date::$(date +'%Y-%m-%d')" |
18 |
| - - name: Test with environment variables |
19 |
| - run: echo $RELEASE_DATE |
20 |
| - env: |
21 |
| - RELEASE_DATE: ${{ steps.date.outputs.date }} |
22 |
| - - name: Fetch pangolin version |
23 |
| - shell: bash |
24 |
| - run: | |
25 |
| - ##Get pangolin-data version |
26 |
| - curl -sL https://api.github.com/repos/cov-lineages/pangolin-data/releases/latest | \ |
27 |
| - jq -r ".tag_name" > versions/pangolin-data-latest-version.txt |
28 |
| - pangolin_data_VER=$(cat versions/pangolin-data-latest-version.txt) |
29 |
| - echo $pangolin_data_VER |
| 14 | + - uses: actions/checkout@v2 |
| 15 | + - name: Get current date |
| 16 | + id: date |
| 17 | + run: echo "::set-output name=date::$(date +'%Y-%m-%d')" |
| 18 | + - name: Test with environment variables |
| 19 | + run: echo $RELEASE_DATE |
| 20 | + env: |
| 21 | + RELEASE_DATE: ${{ steps.date.outputs.date }} |
| 22 | + - name: Fetch pangolin version |
| 23 | + shell: bash |
| 24 | + run: | |
| 25 | + ##Get pangolin-data version |
| 26 | + curl -sL https://api.github.com/repos/cov-lineages/pangolin-data/releases/latest | \ |
| 27 | + jq -r ".tag_name" > versions/pangolin-data-latest-version.txt |
| 28 | + pangolin_data_VER=$(cat versions/pangolin-data-latest-version.txt) |
| 29 | + echo $pangolin_data_VER |
30 | 30 |
|
31 |
| - ##Get constellations version |
32 |
| - curl -sL https://api.github.com/repos/cov-lineages/constellations/releases/latest | \ |
33 |
| - jq -r ".tag_name" > versions/constellations-latest-version.txt |
34 |
| - constellations_VER=$(cat versions/constellations-latest-version.txt) |
35 |
| - echo $constellations_VER |
| 31 | + ##Get constellations version |
| 32 | + curl -sL https://api.github.com/repos/cov-lineages/constellations/releases/latest | \ |
| 33 | + jq -r ".tag_name" > versions/constellations-latest-version.txt |
| 34 | + constellations_VER=$(cat versions/constellations-latest-version.txt) |
| 35 | + echo $constellations_VER |
36 | 36 |
|
37 |
| - ##Get pangolin version |
38 |
| - curl -sL https://api.github.com/repos/cov-lineages/pangolin/releases/latest | \ |
39 |
| - jq -r ".tag_name" > versions/pangolin-latest-version.txt |
40 |
| - PANGOLIN_VER=$(cat versions/pangolin-latest-version.txt) |
41 |
| - echo $PANGOLIN_VER |
| 37 | + ##Get pangolin version |
| 38 | + curl -sL https://api.github.com/repos/cov-lineages/pangolin/releases/latest | \ |
| 39 | + jq -r ".tag_name" > versions/pangolin-latest-version.txt |
| 40 | + PANGOLIN_VER=$(cat versions/pangolin-latest-version.txt) |
| 41 | + echo $PANGOLIN_VER |
42 | 42 |
|
43 |
| - ##Get scorpio version |
44 |
| - curl -sL https://api.github.com/repos/cov-lineages/scorpio/releases/latest | \ |
45 |
| - jq -r ".tag_name" > versions/scorpio-latest-version.txt |
46 |
| - scorpio_VER=$(cat versions/scorpio-latest-version.txt) |
47 |
| - echo $scorpio_VER |
| 43 | + ##Get scorpio version |
| 44 | + curl -sL https://api.github.com/repos/cov-lineages/scorpio/releases/latest | \ |
| 45 | + jq -r ".tag_name" > versions/scorpio-latest-version.txt |
| 46 | + scorpio_VER=$(cat versions/scorpio-latest-version.txt) |
| 47 | + echo $scorpio_VER |
48 | 48 |
|
| 49 | + - name: Check for modified files |
| 50 | + id: git-check |
| 51 | + run: echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") |
49 | 52 |
|
50 |
| - - name: Check for modified files |
51 |
| - id: git-check |
52 |
| - run: echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") |
| 53 | + - name: Login to Docker Hub |
| 54 | + uses: docker/login-action@v1 |
| 55 | + with: |
| 56 | + username: ${{ secrets.DOCKER_HUB_USERNAME }} |
| 57 | + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
53 | 58 |
|
54 |
| - - name: Login to Docker Hub |
55 |
| - uses: docker/login-action@v1 |
56 |
| - with: |
57 |
| - username: ${{ secrets.DOCKER_HUB_USERNAME }} |
58 |
| - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} |
| 59 | + - name: Set up Docker Buildx |
| 60 | + id: buildx |
| 61 | + uses: docker/setup-buildx-action@v1 |
59 | 62 |
|
60 |
| - - name: Set up Docker Buildx |
61 |
| - id: buildx |
62 |
| - uses: docker/setup-buildx-action@v1 |
| 63 | + - name: Build new docker image |
| 64 | + shell: bash |
| 65 | + run: | |
| 66 | + echo ${{ steps.date.outputs.date }} |
| 67 | + REPO_VER=$(cat versions/pangolin-latest-version.txt | sed 's|v||') |
| 68 | + pangolin_data_VER=$(cat versions/pangolin-data-latest-version.txt | sed 's|v||') |
| 69 | + scorpio_VER=$(cat versions/scorpio-latest-version.txt | sed 's|v||') |
| 70 | + constellations_VER=$(cat versions/constellations-latest-version.txt | sed 's|v||') |
| 71 | + #Build docker for pangolin-check for specific requirements |
| 72 | + docker build --no-cache -f environments/pangolin/Dockerfile -t genomicmedicinesweden/gms-artic-pangolin:latest -t genomicmedicinesweden/gms-artic-pangolin:${{ steps.date.outputs.date }}-p-${REPO_VER}-d-${pangolin_data_VER}-c-${constellations_VER}-s-${scorpio_VER} --build-arg PANGOLIN_VER=v${REPO_VER} . |
63 | 73 |
|
64 |
| - - name: Build new docker image |
65 |
| - shell: bash |
66 |
| - run: | |
67 |
| - echo ${{ steps.date.outputs.date }} |
68 |
| - REPO_VER=$(cat versions/pangolin-latest-version.txt | sed 's|v||') |
69 |
| - pangolin_data_VER=$(cat versions/pangolin-data-latest-version.txt | sed 's|v||') |
70 |
| - scorpio_VER=$(cat versions/scorpio-latest-version.txt | sed 's|v||') |
71 |
| - constellations_VER=$(cat versions/constellations-latest-version.txt | sed 's|v||') |
72 |
| - #Build docker for pangolin-check for specific requirements |
73 |
| - docker build --no-cache -f environments/pangolin/Dockerfile -t genomicmedicinesweden/gms-artic-pangolin:latest -t genomicmedicinesweden/gms-artic-pangolin:${{ steps.date.outputs.date }}-p-${REPO_VER}-d-${pangolin_data_VER}-c-${constellations_VER}-s-${scorpio_VER} --build-arg PANGOLIN_VER=v${REPO_VER} . |
| 74 | + - name: Push Docker image to DockerHub |
| 75 | + shell: bash |
| 76 | + run: | |
| 77 | + REPO_VER=$(cat versions/pangolin-latest-version.txt | sed 's|v||') |
| 78 | + pangolin_data_VER=$(cat versions/pangolin-data-latest-version.txt | sed 's|v||') |
| 79 | + scorpio_VER=$(cat versions/scorpio-latest-version.txt | sed 's|v||') |
| 80 | + constellations_VER=$(cat versions/constellations-latest-version.txt | sed 's|v||') |
| 81 | + #Push to dockerhub for pangolin with specific requirements |
| 82 | + docker image push genomicmedicinesweden/gms-artic-pangolin:latest |
| 83 | + docker image push genomicmedicinesweden/gms-artic-pangolin:${{ steps.date.outputs.date }}-p-${REPO_VER}-d-${pangolin_data_VER}-c-${constellations_VER}-s-${scorpio_VER} |
74 | 84 |
|
75 |
| - - name: Push Docker image to DockerHub |
76 |
| - shell: bash |
77 |
| - run: | |
78 |
| - REPO_VER=$(cat versions/pangolin-latest-version.txt | sed 's|v||') |
79 |
| - pangolin_data_VER=$(cat versions/pangolin-data-latest-version.txt | sed 's|v||') |
80 |
| - scorpio_VER=$(cat versions/scorpio-latest-version.txt | sed 's|v||') |
81 |
| - constellations_VER=$(cat versions/constellations-latest-version.txt | sed 's|v||') |
82 |
| - #Push to dockerhub for pangolin with specific requirements |
83 |
| - docker image push genomicmedicinesweden/gms-artic-pangolin:latest |
84 |
| - docker image push genomicmedicinesweden/gms-artic-pangolin:${{ steps.date.outputs.date }}-p-${REPO_VER}-d-${pangolin_data_VER}-c-${constellations_VER}-s-${scorpio_VER} |
| 85 | + keepalive-job: |
| 86 | + name: Keepalive Workflow |
| 87 | + runs-on: ubuntu-latest |
| 88 | + permissions: |
| 89 | + actions: write |
| 90 | + steps: |
| 91 | + - uses: actions/checkout@v2 |
| 92 | + - uses: gautamkrishnar/keepalive-workflow@v2 |
0 commit comments