Skip to content

Snapshots

Snapshots #353

Workflow file for this run

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