Snapshots #622
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |