1
0
mirror of https://github.com/octoleo/plantuml.git synced 2024-12-22 02:49:06 +00:00

Merge pull request #1070 from gliptak/master

Add Docker release to GHA
This commit is contained in:
PlantUML 2022-07-31 22:34:20 +02:00 committed by GitHub
commit 12b9152de3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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