-
Notifications
You must be signed in to change notification settings - Fork 5
138 lines (127 loc) · 4.67 KB
/
java-publish.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
131
132
133
134
135
136
name: Publish and deploy
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
env:
SERVICE_NAME: ${{ github.event.repository.name }}
GOOGLE_PROJECT: dsp-artifact-registry
GOOGLE_DOCKER_REPOSITORY: us-central1-docker.pkg.dev
IMAGE_REPOSITORY_NAME: ddp
jobs:
get-version-tag:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- name: Checkout Current Code
uses: actions/checkout@v3
with:
token: ${{ secrets.BROADBOT_TOKEN }}
- name: Parse Tag
id: tag
run: echo "tag=$(git describe --tags)" >> $GITHUB_OUTPUT
publish-admin-image:
needs: get-version-tag
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.build-publish.outputs.published-image }}
steps:
- name: Checkout Current Code
uses: actions/checkout@v3
with:
token: ${{ secrets.BROADBOT_TOKEN }}
- name: build and publish image
id: build-publish
uses: ./.github/actions/build-push-image
with:
version-tag: ${{ needs.get-version-tag.outputs.tag }}
image-repo: 'us-central1-docker.pkg.dev'
image-name: "dsp-artifact-registry/ddp/${{ github.event.repository.name }}-admin"
gradle-build-args: ':api-admin:jibDockerBuild'
- name: Notify slack on failure
uses: broadinstitute/[email protected]
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
channel: '#juniper-dev-notifications'
status: failure
author_name: Publish docker Image
fields: job
text: "Publish failed :sadpanda:, image ${{ steps.build-publish.outputs.published-image }} failed to publish"
username: 'Juniper Build Notifications'
publish-participant-image:
needs: get-version-tag
permissions:
contents: 'read'
id-token: 'write'
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.build-publish.outputs.published-image }}
steps:
- name: Checkout Current Code
uses: actions/checkout@v3
with:
token: ${{ secrets.BROADBOT_TOKEN }}
- name: build and publish image
id: build-publish
uses: ./.github/actions/build-push-image
with:
version-tag: ${{ needs.get-version-tag.outputs.tag }}
image-repo: 'us-central1-docker.pkg.dev'
image-name: "dsp-artifact-registry/ddp/${{ github.event.repository.name }}-participant"
gradle-build-args: ':api-participant:jibDockerBuild'
- name: Notify slack on failure
uses: broadinstitute/[email protected]
if: failure()
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
channel: '#juniper-dev-notifications'
status: failure
author_name: Publish docker Image
fields: job
text: "Publish failed :sadpanda:, image ${{ steps.build-publish.outputs.published-image }} failed to publish"
username: 'Juniper Build Notifications'
report-to-sherlock:
# Report new version of application to DSP DevOps Tooling
uses: broadinstitute/sherlock/.github/workflows/client-report-app-version.yaml@main
needs: [publish-admin-image, publish-participant-image, get-version-tag]
with:
new-version: ${{ needs.get-version-tag.outputs.tag }}
chart-name: 'd2p'
permissions:
contents: 'read'
id-token: 'write'
set-version-in-dev:
# Put new version in ddp-azure-dev environment
uses: broadinstitute/sherlock/.github/workflows/client-set-environment-app-version.yaml@main
needs: [publish-admin-image, publish-participant-image, report-to-sherlock, get-version-tag]
with:
new-version: ${{ needs.get-version-tag.outputs.tag }}
chart-name: 'd2p'
environment-name: 'ddp-azure-dev'
secrets:
sync-git-token: ${{ secrets.BROADBOT_TOKEN }}
permissions:
id-token: 'write'
notify-upon-completion:
runs-on: ubuntu-latest
if: always()
needs: [set-version-in-dev, get-version-tag]
steps:
- uses: broadinstitute/[email protected]
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
with:
channel: '#juniper-dev-notifications'
# Result status on the set version in dev job which actually performs the deploy
status: ${{ needs.set-version-in-dev.result }}
author_name: Auto Deploy to Dev
fields: job
text: Deploy to dev of ${{ needs.get-version-tag.outputs.tag }} resulted in ${{ needs.set-version-in-dev.result }}
username: 'Juniper Build Notifications'