-
-
Notifications
You must be signed in to change notification settings - Fork 6
125 lines (115 loc) · 4.42 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Snapshots
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
inputs: { }
env:
CI: true
jobs:
linux-jvm-tests:
if: ${{ github.event_name != 'pull_request' && github.repository_owner == 'project-openubl' }}
name: Test real padron reducido
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: 17
distribution: temurin
cache: maven
- name: Maven
run: mvn test -f application -Dtest=DataHelperTest -Dsearchpe.sunat.padronReducidoUrl=http://www2.sunat.gob.pe/padron_reducido_ruc.zip
application-container:
needs: [ linux-jvm-tests ]
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=searchpe \
-Dquarkus.container-image.tag=latest \
-P native,ui \
-pl application
- name: Save container image
run: docker save -o searchpe-container-image.tar quay.io/projectopenubl/searchpe:latest
- name: Upload container image
uses: actions/upload-artifact@v3
with:
name: artifacts
path: searchpe-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=searchpe-operator \
-Dquarkus.container-image.tag=latest \
-P native \
-pl operator
- name: Save container image
run: docker save -o searchpe-operator-container-image.tar quay.io/projectopenubl/searchpe-operator:latest
- name: Upload container image
uses: actions/upload-artifact@v3
with:
name: artifacts
path: searchpe-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/searchpe-container-image.tar
docker load -i artifacts/searchpe-operator-container-image.tar
# Tag images
docker tag quay.io/projectopenubl/searchpe:latest quay.io/projectopenubl/searchpe:nightly
docker tag quay.io/projectopenubl/searchpe:latest ghcr.io/project-openubl/searchpe/searchpe:nightly
docker tag quay.io/projectopenubl/searchpe-operator:latest quay.io/projectopenubl/searchpe-operator:nightly
docker tag quay.io/projectopenubl/searchpe-operator:latest ghcr.io/project-openubl/searchpe/searchpe-operator:nightly
- name: Push images to registry
run: |
docker push quay.io/projectopenubl/searchpe:nightly
docker push ghcr.io/project-openubl/searchpe/searchpe:nightly
docker push quay.io/projectopenubl/searchpe-operator:nightly
docker push ghcr.io/project-openubl/searchpe/searchpe-operator:nightly