Skip to content

Color harmonization for tags context information #293

Color harmonization for tags context information

Color harmonization for tags context information #293

Workflow file for this run

name: "Staging"
on:
push:
branches:
- "staging"
jobs:
build:
runs-on: ubuntu-latest
env:
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version"
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
java-version: 21
distribution: "temurin"
- name: Set up Maven
uses: stCarolas/setup-maven@v5
with:
maven-version: 3.9.9
- name: Cache
uses: actions/cache@v5
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Install clamdscan
run: sudo apt-get update && sudo apt-get install clamdscan -y
- name: Run tests & install
run: mvn $MAVEN_CLI_OPTS -Dtestng.groups="travis" -Denforcer.skip=true clean org.jacoco:jacoco-maven-plugin:prepare-agent install
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare JAR for artifact upload
run: |
mkdir -p /tmp/roda-jar
cp roda-ui/roda-wui/target/roda-wui-*.jar /tmp/roda-jar/
- name: Upload JAR artifact
uses: actions/upload-artifact@v7
with:
name: roda-jar
path: /tmp/roda-jar/
retention-days: 1
docker:
runs-on: ${{ matrix.runner }}
needs: build
strategy:
fail-fast: false
matrix:
include:
- platform: linux/amd64
runner: ubuntu-latest
- platform: linux/arm64
runner: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v7
- name: Prepare platform tag
run: echo "platform_tag=$(echo "${{ matrix.platform }}" | tr '/' '-')" >> $GITHUB_ENV
- name: Download JAR artifact
uses: actions/download-artifact@v8
with:
name: roda-jar
path: docker/target
- name: Docker meta
id: meta
uses: docker/metadata-action@v6
with:
images: ghcr.io/keeps/roda
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push by digest
id: build
uses: docker/build-push-action@v7
with:
context: docker
platforms: ${{ matrix.platform }}
labels: ${{ steps.meta.outputs.labels }}
sbom: true
provenance: mode=max
outputs: type=image,name=ghcr.io/keeps/roda,push-by-digest=true,name-canonical=true,push=true
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
- name: Upload digest
uses: actions/upload-artifact@v7
with:
name: digests-${{ env.platform_tag }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1
merge:
runs-on: ubuntu-latest
needs: docker
steps:
- name: Download digests
uses: actions/download-artifact@v8
with:
path: /tmp/digests
pattern: digests-*
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to DockerHub container registry
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Create manifest list and push to GHCR
working-directory: /tmp/digests
run: |
docker buildx imagetools create \
-t ghcr.io/keeps/roda:staging \
$(printf 'ghcr.io/keeps/roda@sha256:%s ' *)
- name: Create manifest list and push to DockerHub
working-directory: /tmp/digests
run: |
docker buildx imagetools create \
-t keeps/roda:staging \
$(printf 'ghcr.io/keeps/roda@sha256:%s ' *)
- name: Inspect image
run: docker buildx imagetools inspect ghcr.io/keeps/roda:staging
- name: Trigger KEEPS GitLab CI/CD
run: |
curl -X POST \
--fail \
-F token=${{ secrets.GITLAB_RODA_DEV_TRIGGER_TOKEN }} \
-F variables[DOCKER_TAG]=staging \
-F ref=staging \
${{ secrets.GITLAB_RODA_DEV_TRIGGER }}