Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Push

on:
push:
branches: [master]
pull_request:
branches: [master]

env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
PDFTK_VERSION: "3.3.3"

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- uses: docker/setup-buildx-action@v3

- uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.IMAGE_NAME }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=${{ env.PDFTK_VERSION }}

- uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ FROM alpine

WORKDIR /app

ENV PATH "$PATH:/app"
ENV PATH="$PATH:/app"

ARG OPENJDK_RELEASE=8
ARG PDFTK_RELEASE=v3.0.6
ARG OPENJDK_RELEASE=25
ARG PDFTK_RELEASE=v3.3.3

RUN set -x \
&& apk add \
Expand All @@ -21,7 +21,7 @@ RUN set -x \
https://gitlab.com/pdftk-java/pdftk \
&& gradle --no-daemon --parallel --quiet --no-build-cache \
-p pdftk shadowJar \
&& mv pdftk/build/libs/pdftk.jar ./ \
&& mv pdftk/build/libs/pdftk-all.jar ./pdftk.jar \
&& apk del .build-deps \
&& rm -rf \
/root/.gradle \
Expand Down
Loading