-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (65 loc) · 2.2 KB
/
ci-release.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
name: ci-release
on:
release:
types:
- created
jobs:
build:
runs-on: ubuntu-22.04
env:
APP_VERSION: ${{ github.event.release.tag_name }}
steps:
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: adopt
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/cache@v3
with:
path: |
~/.m2/repository
key: ${{ runner.os }}-${{ hashFiles('**/pom.xml') }}
- name: mvn
run: |-
mvn versions:set \
--batch-mode \
--file ./pom.xml \
--settings ./settings.xml \
--define newVersion="${APP_VERSION}"
mvn clean deploy \
--batch-mode \
--file ./pom.xml \
--settings ./settings.xml \
--define app.packages.username="${APP_PACKAGES_USERNAME}" \
--define app.packages.password="${APP_PACKAGES_PASSWORD}"
env:
APP_PACKAGES_USERNAME: ${{ github.actor }}
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: docker
run: |-
echo "${APP_PACKAGES_PASSWORD}" | docker login "${APP_PACKAGES_URL}" \
--username "${APP_PACKAGES_USERNAME}" \
--password-stdin
docker build . \
--file ./Dockerfile \
--tag "${APP_PACKAGES_URL}:latest" \
--tag "${APP_PACKAGES_URL}:${APP_VERSION}"
docker push "${APP_PACKAGES_URL}:latest"
docker push "${APP_PACKAGES_URL}:${APP_VERSION}"
docker build .
--file ./DB-Changelog-Dockerfile
--tag "${APP_PACKAGES_URL}-initcontainer:${APP_VERSION}";
docker push "${APP_PACKAGES_URL}-initcontainer:${APP_VERSION}";
env:
APP_PACKAGES_URL: ghcr.io/worldhealthorganization/tng-key-distribution/tng-key-distribution
APP_PACKAGES_USERNAME: ${{ github.actor }}
APP_PACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
- name: assets
run: |-
gh release upload ${APP_VERSION} \
--clobber \
./target/generated-resources/licenses.xml#licenses-${APP_VERSION}.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}