Skip to content

Commit 4c8d7de

Browse files
Add workflow to publish docker images
1 parent 36c282f commit 4c8d7de

File tree

2 files changed

+71
-1
lines changed

2 files changed

+71
-1
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Publish Docker Images
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version tag for docker images (e.g. 25.12)'
8+
required: true
9+
type: string
10+
push:
11+
description: 'Push images to Docker Hub'
12+
required: true
13+
type: boolean
14+
default: false
15+
latest:
16+
description: 'Also tag openjdk18-bullseye-spring as latest'
17+
required: true
18+
type: boolean
19+
default: false
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
framework: [spring, dropwizard]
28+
jdk: [openjdk8, openjdk11, openjdk18]
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v4
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v3
35+
36+
- name: Login to Docker Hub
37+
if: ${{ inputs.push }}
38+
uses: docker/login-action@v3
39+
with:
40+
username: ${{ secrets.DOCKERHUB_USERNAME }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
43+
- name: Set context directory
44+
id: ctx
45+
run: |
46+
if [ "${{ matrix.framework }}" = "spring" ]; then
47+
echo "dir=Demos/Spring" >> "$GITHUB_OUTPUT"
48+
else
49+
echo "dir=Demos/Dropwizard" >> "$GITHUB_OUTPUT"
50+
fi
51+
52+
- name: Determine tags
53+
id: tags
54+
run: |
55+
TAG="groupdocs/viewer:${{ inputs.version }}-java-${{ matrix.jdk }}-bullseye-${{ matrix.framework }}"
56+
TAGS="${TAG}"
57+
if [ "${{ inputs.latest }}" = "true" ] && [ "${{ matrix.framework }}" = "spring" ] && [ "${{ matrix.jdk }}" = "openjdk18" ]; then
58+
TAGS="${TAGS},groupdocs/viewer:latest"
59+
fi
60+
echo "tags=${TAGS}" >> "$GITHUB_OUTPUT"
61+
62+
- name: Build and push
63+
uses: docker/build-push-action@v6
64+
with:
65+
context: ${{ steps.ctx.outputs.dir }}
66+
file: ${{ steps.ctx.outputs.dir }}/docker/Dockerfile-${{ matrix.jdk }}-bullseye
67+
push: ${{ inputs.push }}
68+
tags: ${{ steps.tags.outputs.tags }}
69+
cache-from: type=gha
70+
cache-to: type=gha,mode=max

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2018 Aspose Pty Ltd
3+
Copyright (c) 2026 Aspose Pty Ltd
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)