-
Notifications
You must be signed in to change notification settings - Fork 11
103 lines (102 loc) · 3.74 KB
/
cd.yaml
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: cd
on:
pull_request:
branches: [main]
types: [closed]
workflow_dispatch:
jobs:
build_push_metatlas_shifter_image:
name: Build/push doejgi/metatlas_shifter docker image
if: github.repository == 'biorack/metatlas' && (github.event.pull_request.merged || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: generate version_info file
run: python ./docker/most_recent_commits.py > docker/.version_info
- name: generate time based tag
id: timestamp
run: |
DATE_TIME=$(date -u +"%Y%m%d_%H%M%S")
echo "date_time=${DATE_TIME}" >> $GITHUB_OUTPUT
- name: Build Docker images # This is for the targeted metatlas pipeline
id: build
uses: docker/build-push-action@v5
with:
context: ./docker
file: ./docker/Dockerfile.shifter
platforms: linux/amd64
cache-from: type=registry,ref=ghcr.io/biorack/metatlas/metatlas_shifter:latest
cache-to: type=inline
tags: |
ghcr.io/biorack/metatlas/metatlas_shifter:${{ steps.timestamp.outputs.date_time }}
ghcr.io/biorack/metatlas/metatlas_shifter:latest
push: true
build_push_metatlas_analysis_image:
name: Build/push analysis docker image
if: github.repository == 'biorack/metatlas' && (github.event.pull_request.merged || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: generate time based tag
id: timestamp
run: |
DATE_TIME=$(date -u +"%Y%m%d_%H%M%S")
echo "date_time=${DATE_TIME}" >> $GITHUB_OUTPUT
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker images # This is for the boutique analysis tasks
id: build_analysis
uses: docker/build-push-action@v5
with:
context: ./docker
file: ./docker/Dockerfile.analysis
platforms: linux/amd64
cache-from: type=registry,ref=ghcr.io/biorack/metatlas/analysis:latest
cache-to: type=inline
tags: |
ghcr.io/biorack/metatlas/analysis:${{ steps.timestamp.outputs.date_time }}
ghcr.io/biorack/metatlas/analysis:latest
push: true
build_push_metatlas_mzmine_image:
name: Build/push mzmine docker image
if: github.repository == 'biorack/metatlas' && (github.event.pull_request.merged || github.event_name == 'workflow_dispatch')
runs-on: ubuntu-22.04
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: generate time based tag
id: timestamp
run: |
DATE_TIME=$(date -u +"%Y%m%d_%H%M%S")
echo "date_time=${DATE_TIME}" >> $GITHUB_OUTPUT
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker images # This is for the mzmine container
id: build_mzmine
uses: docker/build-push-action@v5
with:
context: ./docker
file: ./docker/Dockerfile.mzmine
platforms: linux/amd64
cache-from: type=registry,ref=ghcr.io/biorack/metatlas/mzmine:latest
cache-to: type=inline
tags: |
ghcr.io/biorack/metatlas/mzmine:${{ steps.timestamp.outputs.date_time }}
ghcr.io/biorack/metatlas/mzmine:latest
push: true