1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-11-25 14:27:33 +00:00

Add Docker release to GHA

Signed-off-by: Gábor Lipták <gliptak@gmail.com>
This commit is contained in:
Gábor Lipták 2022-07-29 20:40:52 -04:00
parent e19e261bb9
commit ba5fef7181
No known key found for this signature in database
GPG Key ID: 8551785584B8BFFD
2 changed files with 38 additions and 2 deletions

View File

@ -161,3 +161,39 @@ jobs:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ github.token }}
TAG: ${{ github.event.ref }} TAG: ${{ github.event.ref }}
run: .github/scripts/release.sh run: .github/scripts/release.sh
push_to_registry:
needs: [ workflow_config, test, upload ]
if: needs.workflow_config.outputs.do_release == 'true'
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
ghcr.io/${{ github.repository }}
# generate Docker tags based on the following events/attributes
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=sha
- name: Log in to GitHub Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build/push container image
uses: docker/build-push-action@v3
with:
context: .
push: true
build-args: |
PLANTUML_VERSION=${{ github.event.ref }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -1,12 +1,12 @@
FROM openjdk:17-alpine FROM openjdk:17-alpine
ARG PLANTUML_VERSION=1.2022.6 ARG PLANTUML_VERSION=v1.2022.6
ENV LANG en_US.UTF-8 ENV LANG en_US.UTF-8
RUN \ RUN \
apk add --no-cache graphviz wget ca-certificates ttf-dejavu && \ apk add --no-cache graphviz wget ca-certificates ttf-dejavu && \
wget "https://github.com/plantuml/plantuml/releases/download/v${PLANTUML_VERSION}/plantuml-${PLANTUML_VERSION}.jar" -O /opt/plantuml.jar && \ wget "https://github.com/plantuml/plantuml/releases/download/${PLANTUML_VERSION}/plantuml-${PLANTUML_VERSION#?}.jar" -O /opt/plantuml.jar && \
apk del wget ca-certificates apk del wget ca-certificates
WORKDIR /data WORKDIR /data