-
Notifications
You must be signed in to change notification settings - Fork 13
109 lines (101 loc) · 3.83 KB
/
snapshots.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
name: Snapshots
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs: { }
env:
CI: true
jobs:
application-container:
name: application Container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Build container image
run: |
mvn -U -B package --file pom.xml -DskipTests \
-Dquarkus.native.container-build=true \
-Dquarkus.container-image.push=false \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.registry=quay.io \
-Dquarkus.container-image.group=projectopenubl \
-Dquarkus.container-image.name=ublhub \
-Dquarkus.container-image.tag=latest \
-P native,ui \
-pl application
- name: Save container image
run: docker save -o ublhub-container-image.tar quay.io/projectopenubl/ublhub:latest
- name: Upload container image
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ublhub-container-image.tar
operator-container:
name: Operator container
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Build container image
run: |
mvn -U -B package --file pom.xml -DskipTests \
-Dquarkus.native.container-build=true \
-Dquarkus.container-image.push=false \
-Dquarkus.container-image.build=true \
-Dquarkus.container-image.registry=quay.io \
-Dquarkus.container-image.group=projectopenubl \
-Dquarkus.container-image.name=ublhub-operator \
-Dquarkus.container-image.tag=latest \
-P native \
-pl operator
- name: Save container image
run: docker save -o ublhub-operator-container-image.tar quay.io/projectopenubl/ublhub-operator:latest
- name: Upload container image
uses: actions/upload-artifact@v3
with:
name: artifacts
path: ublhub-operator-container-image.tar
publish-container:
needs: [ application-container, operator-container ]
name: Publish container
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- name: Login to Ghcr.io
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAYIO_USERNAME }}
password: ${{ secrets.QUAYIO_PASSWORD }}
- name: Load and config images
run: |
# Load images from .tar
docker load -i artifacts/ublhub-container-image.tar
docker load -i artifacts/ublhub-operator-container-image.tar
# Tag images
docker tag quay.io/projectopenubl/ublhub:latest quay.io/projectopenubl/ublhub:nightly
docker tag quay.io/projectopenubl/ublhub:latest ghcr.io/project-openubl/ublhub/ublhub:nightly
docker tag quay.io/projectopenubl/ublhub-operator:latest quay.io/projectopenubl/ublhub-operator:nightly
docker tag quay.io/projectopenubl/ublhub-operator:latest ghcr.io/project-openubl/ublhub/ublhub-operator:nightly
- name: Push images to registry
run: |
docker push quay.io/projectopenubl/ublhub:nightly
docker push ghcr.io/project-openubl/ublhub/ublhub:nightly
docker push quay.io/projectopenubl/ublhub-operator:nightly
docker push ghcr.io/project-openubl/ublhub/ublhub-operator:nightly