-
Notifications
You must be signed in to change notification settings - Fork 580
130 lines (120 loc) · 4.15 KB
/
dockerimage.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: Docker Image CI
on:
push:
branches:
- master
- release-*
- rc
- rfc*
- demo-*
- fusion-sv-migration
- redis-branch-up-to-date
tags: '*'
jobs:
build_and_publish_web_and_data:
if: github.repository == 'cBioPortal/cbioportal'
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: 'Create application.properties'
run: |
cp src/main/resources/application.properties.EXAMPLE src/main/resources/application.properties
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
cbioportal/cbioportal
# The latest tag will also be generated on tag event with a valid semver tag
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# The following two actions are required to build multi-platform images
# buildx is an extension of docker build, QUEM is used to convert the binary to varies architecture
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Publish Docker Image on Tag
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
file: docker/web-and-data/Dockerfile
cache-from: type=gha
cache-to: type=gha
build_and_publish_web:
if: github.repository == 'cBioPortal/cbioportal'
runs-on: ubuntu-latest
steps:
- name: Checkout git repo
uses: actions/checkout@v3
- name: 'Create application.properties'
run: |
cp src/main/resources/application.properties.EXAMPLE src/main/resources/application.properties
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
cbioportal/cbioportal
# Do not generate latest tag
flavor: |
latest=false
suffix=-web-shenandoah
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# The following two actions are required to build multi-platform images
# buildx is an extension of docker build, QUEM is used to convert the binary to varies architecture
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Publish Docker Image on Tag
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
platforms: linux/amd64,linux/arm64
file: docker/web/Dockerfile
cache-from: type=gha
cache-to: type=gha
update_dependency_graph:
needs: build_and_publish_web
if: github.repository == 'cBioPortal/cbioportal' && github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Extract metadata
id: meta
uses: docker/metadata-action@v4
with:
images: |
cbioportal/cbioportal
# Do not generate latest tag
flavor: |
latest=false
suffix=-web-shenandoah
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
- name: Update Github Dependency Graph
uses: anchore/sbom-action@v0
with:
image: ${{ steps.meta.outputs.tags }}
dependency-snapshot: 'true'
github-token: '${{ secrets.GITHUB_TOKEN }}'