-
Notifications
You must be signed in to change notification settings - Fork 0
93 lines (92 loc) · 3.81 KB
/
build.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
name: Build packages
on:
push:
tags:
- v[0-9]+.[0-9]+**
jobs:
debian:
runs-on: ubuntu-latest
steps:
- name: Prepare Version
id: prep
run: |
echo ::set-output name=user::$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
echo ::set-output name=repo::$(echo "${{ github.repository }}" | awk -F / '{print $2}' | tr '[:upper:]' '[:lower:]')
echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
- uses: actions/checkout@v2
- name: Build
run: debian/build.sh "aktin-notaufnahme-i2b2" "${{ steps.prep.outputs.version }}"
- name: Sign package
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
if: env.GPG_SIGNING_KEY != null
run: |
echo -n "$GPG_SIGNING_KEY" | gpg --import
sudo apt update && sudo apt install -y dpkg-sig
dpkg-sig --sign builder debian/build/aktin-notaufnahme-i2b2_${{ steps.prep.outputs.version }}.deb
- name: Upload build artifact
uses: actions/upload-artifact@v2
with:
name: aktin-notaufnahme-i2b2_${{ steps.prep.outputs.version }}.deb
path: debian/build/aktin-notaufnahme-i2b2_${{ steps.prep.outputs.version }}.deb
docker:
runs-on: ubuntu-latest
steps:
- name: Prepare Version
id: prep
run: |
echo ::set-output name=user::$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
echo ::set-output name=repo::$(echo "${{ github.repository }}" | awk -F / '{print $2}' | tr '[:upper:]' '[:lower:]')
echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
- uses: actions/checkout@v2
- name: Prepare docker builds
run: docker/build.sh "aktin-notaufnahme-i2b2" "${{ steps.prep.outputs.version }}"
- name: Login to GitHub Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push docker image for ${{ github.job }} [httpd]
uses: docker/build-push-action@v2
with:
context: docker/build/httpd
tags: |
ghcr.io/aktin/notaufnahme-i2b2-httpd:latest
ghcr.io/aktin/notaufnahme-i2b2-httpd:${{ steps.prep.outputs.version }}
push: true
- name: Build and push docker image for ${{ github.job }} [database]
uses: docker/build-push-action@v2
with:
context: docker/build/database
tags: |
ghcr.io/aktin/notaufnahme-i2b2-database:latest
ghcr.io/aktin/notaufnahme-i2b2-database:${{ steps.prep.outputs.version }}
push: true
- name: Build and push docker image for ${{ github.job }} [wildfly]
uses: docker/build-push-action@v2
with:
context: docker/build/wildfly
tags: |
ghcr.io/aktin/notaufnahme-i2b2-wildfly:latest
ghcr.io/aktin/notaufnahme-i2b2-wildfly:${{ steps.prep.outputs.version }}
push: true
gh-release:
runs-on: ubuntu-latest
needs:
- debian
steps:
- name: Prepare Version
id: prep
run: |
echo ::set-output name=user::$(echo "${{ github.repository_owner }}" | tr '[:upper:]' '[:lower:]')
echo ::set-output name=repo::$(echo "${{ github.repository }}" | awk -F / '{print $2}' | tr '[:upper:]' '[:lower:]')
echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
- uses: actions/download-artifact@v2
with:
name: aktin-notaufnahme-i2b2_${{ steps.prep.outputs.version }}.deb
- name: Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
files: aktin-notaufnahme-i2b2_${{ steps.prep.outputs.version }}.deb