mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2026-11-02 04:55:36 +00:00
Bumps the actions group with 16 updates: | Package | From | To | | --- | --- | --- | | [actions/setup-python](https://github.com/actions/setup-python) | `7.0.0` | `7.1.0` | | [docker/login-action](https://github.com/docker/login-action) | `4.6.0` | `4.7.0` | | [actions/upload-artifact](https://github.com/actions/upload-artifact) | `7.0.1` | `7.0.2` | | [actions/download-artifact](https://github.com/actions/download-artifact) | `8.0.1` | `8.0.2` | | [actions/setup-node](https://github.com/actions/setup-node) | `7.0.0` | `7.1.0` | | [j178/prek-action](https://github.com/j178/prek-action) | `3.0.0` | `3.1.0` | | [release-drafter/release-drafter](https://github.com/release-drafter/release-drafter) | `7.7.0` | `7.10.0` | | [shogo82148/actions-upload-release-asset](https://github.com/shogo82148/actions-upload-release-asset) | `1.10.4` | `1.10.6` | | [zizmorcore/zizmor-action](https://github.com/zizmorcore/zizmor-action) | `0.6.4` | `0.8.0` | | [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) | `4.38.2` | `4.39.1` | | [stumpylog/image-cleaner-action/ephemeral](https://github.com/stumpylog/image-cleaner-action) | `0.13.0` | `0.13.1` | | [stumpylog/image-cleaner-action/untagged](https://github.com/stumpylog/image-cleaner-action) | `0.13.0` | `0.13.1` | | [github/codeql-action/init](https://github.com/github/codeql-action) | `4.38.2` | `4.39.1` | | [github/codeql-action/analyze](https://github.com/github/codeql-action) | `4.38.2` | `4.39.1` | | [crowdin/github-action](https://github.com/crowdin/github-action) | `3.3.0` | `3.5.0` | | [stefanzweifel/git-auto-commit-action](https://github.com/stefanzweifel/git-auto-commit-action) | `7.2.0` | `7.2.1` | Updates `actions/setup-python` from 7.0.0 to 7.1.0 - [Release notes](https://github.com/actions/setup-python/releases) - [Commits](https://github.com/actions/setup-python/compare/5fda3b95a4ea91299a34e894583c3862153e4b97...6d4fd22b20465ccc0f7354476588e8df7c9ca0e0) Updates `docker/login-action` from 4.6.0 to 4.7.0 - [Release notes](https://github.com/docker/login-action/releases) - [Commits](https://github.com/docker/login-action/compare/dbcb813823bdd20940b903addbd779551569679f...81c6f93d4bc991e510b342a00b419b3bb4efc5c6) Updates `actions/upload-artifact` from 7.0.1 to 7.0.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/043fb46d1a93c77aae656e7c1c64a875d1fc6a0a...cf430e030ddbb5b0abf93d22962f4752f3646cd9) Updates `actions/download-artifact` from 8.0.1 to 8.0.2 - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c...9000827ccba6bdab643e8b6fd33ac0654aef8333) Updates `actions/setup-node` from 7.0.0 to 7.1.0 - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/820762786026740c76f36085b0efc47a31fe5020...949feb2413d6458794dcd2491c4babbbce0c15c1) Updates `j178/prek-action` from 3.0.0 to 3.1.0 - [Release notes](https://github.com/j178/prek-action/releases) - [Commits](https://github.com/j178/prek-action/compare/4e14d07f9231acabce116ccfca13b13dd9755ece...44924fe9ef4a6f88253c4b6b1bf11c689d3ce53d) Updates `release-drafter/release-drafter` from 7.7.0 to 7.10.0 - [Release notes](https://github.com/release-drafter/release-drafter/releases) - [Commits](https://github.com/release-drafter/release-drafter/compare/34d80673e067bdc0c24568d3af899c216adcfaa9...978bb0b30c5ee8cdd332ced253758157150d43f0) Updates `shogo82148/actions-upload-release-asset` from 1.10.4 to 1.10.6 - [Release notes](https://github.com/shogo82148/actions-upload-release-asset/releases) - [Commits](https://github.com/shogo82148/actions-upload-release-asset/compare/aaba0f56bdbc1071f4af234d5cb16055e8a400de...9ee13965a8a51926f330b424693f25fcff8f2ef6) Updates `zizmorcore/zizmor-action` from 0.6.4 to 0.8.0 - [Release notes](https://github.com/zizmorcore/zizmor-action/releases) - [Commits](https://github.com/zizmorcore/zizmor-action/compare/cc914d7f3750a2d13d75c7f184a1060aa0e9d482...53290badfa369cb0bf7ad16342cb62c2fa47ac7b) Updates `github/codeql-action/upload-sarif` from 4.38.2 to 4.39.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2...9b3254085494b55a0f7c4c2b3d2d52cc712ce370) Updates `stumpylog/image-cleaner-action/ephemeral` from 0.13.0 to 0.13.1 - [Release notes](https://github.com/stumpylog/image-cleaner-action/releases) - [Changelog](https://github.com/stumpylog/image-cleaner-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/stumpylog/image-cleaner-action/compare/21f875bab2376314e0525c614e923c669434f0e4...9f582a6be546d93ea5c02c1446d41f8e17673db6) Updates `stumpylog/image-cleaner-action/untagged` from 0.13.0 to 0.13.1 - [Release notes](https://github.com/stumpylog/image-cleaner-action/releases) - [Changelog](https://github.com/stumpylog/image-cleaner-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/stumpylog/image-cleaner-action/compare/21f875bab2376314e0525c614e923c669434f0e4...9f582a6be546d93ea5c02c1446d41f8e17673db6) Updates `github/codeql-action/init` from 4.38.2 to 4.39.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2...9b3254085494b55a0f7c4c2b3d2d52cc712ce370) Updates `github/codeql-action/analyze` from 4.38.2 to 4.39.1 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](https://github.com/github/codeql-action/compare/2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2...9b3254085494b55a0f7c4c2b3d2d52cc712ce370) Updates `crowdin/github-action` from 3.3.0 to 3.5.0 - [Release notes](https://github.com/crowdin/github-action/releases) - [Commits](https://github.com/crowdin/github-action/compare/9c23991700c0ec5256fd41089b9d9d7d540e424e...959dc74ac104447731cba99a016f85d0ae719788) Updates `stefanzweifel/git-auto-commit-action` from 7.2.0 to 7.2.1 - [Release notes](https://github.com/stefanzweifel/git-auto-commit-action/releases) - [Changelog](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/CHANGELOG.md) - [Commits](https://github.com/stefanzweifel/git-auto-commit-action/compare/4a55954c782fc1ea30b9056cd3e7a2b40ca8887d...d0b01107b5db882071f96de5dd4b54961ea93f4c) --- updated-dependencies: - dependency-name: actions/setup-python dependency-version: 7.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: docker/login-action dependency-version: 4.7.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: actions/upload-artifact dependency-version: 7.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/download-artifact dependency-version: 8.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: actions/setup-node dependency-version: 7.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: j178/prek-action dependency-version: 3.1.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: release-drafter/release-drafter dependency-version: 7.10.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: shogo82148/actions-upload-release-asset dependency-version: 1.10.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: zizmorcore/zizmor-action dependency-version: 0.8.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: github/codeql-action/upload-sarif dependency-version: 4.39.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: stumpylog/image-cleaner-action/ephemeral dependency-version: 0.13.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: stumpylog/image-cleaner-action/untagged dependency-version: 0.13.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions - dependency-name: github/codeql-action/init dependency-version: 4.39.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: github/codeql-action/analyze dependency-version: 4.39.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: crowdin/github-action dependency-version: 3.5.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: actions - dependency-name: stefanzweifel/git-auto-commit-action dependency-version: 7.2.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: actions ... Signed-off-by: dependabot[bot] <support@github.com>
260 lines
10 KiB
YAML
260 lines
10 KiB
YAML
name: Docker Build
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v[0-9]+.[0-9]+.[0-9]+'
|
|
- 'v[0-9]+.[0-9]+.[0-9]+-beta.rc[0-9]+'
|
|
branches:
|
|
- dev
|
|
- beta
|
|
pull_request:
|
|
branches:
|
|
- dev
|
|
- main
|
|
workflow_dispatch:
|
|
concurrency:
|
|
group: docker-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
env:
|
|
REGISTRY: ghcr.io
|
|
jobs:
|
|
build-arch:
|
|
name: Build ${{ matrix.arch }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- runner: ubuntu-26.04
|
|
arch: amd64
|
|
platform: linux/amd64
|
|
- runner: ubuntu-26.04-arm
|
|
arch: arm64
|
|
platform: linux/arm64
|
|
runs-on: ${{ matrix.runner }}
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
outputs:
|
|
should-push: ${{ steps.check-push.outputs.should-push }}
|
|
push-external: ${{ steps.check-push.outputs.push-external }}
|
|
repository: ${{ steps.repo.outputs.name }}
|
|
ref-name: ${{ steps.ref.outputs.name }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
with:
|
|
persist-credentials: false
|
|
- name: Determine ref name
|
|
id: ref
|
|
run: |
|
|
ref_name="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
|
|
# Sanitize by replacing / with - for use in tags and cache keys
|
|
sanitized_ref="${ref_name//\//-}"
|
|
|
|
echo "ref_name=${ref_name}"
|
|
echo "sanitized_ref=${sanitized_ref}"
|
|
|
|
echo "name=${sanitized_ref}" >> $GITHUB_OUTPUT
|
|
- name: Check push permissions
|
|
id: check-push
|
|
env:
|
|
REF_NAME: ${{ steps.ref.outputs.name }}
|
|
run: |
|
|
# should-push: Should we push to GHCR?
|
|
# True for:
|
|
# 1. Pushes (tags/dev/beta) - filtered via the workflow triggers
|
|
# 2. Manual dispatch - always push to GHCR
|
|
# 3. Internal PRs where the branch name starts with 'feature-' or 'fix-'
|
|
|
|
should_push="false"
|
|
if [[ "${{ github.event_name }}" == "push" ]]; then
|
|
should_push="true"
|
|
elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
|
|
should_push="true"
|
|
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.head.repo.full_name }}" == "${{ github.repository }}" ]]; then
|
|
if [[ "${REF_NAME}" == feature-* || "${REF_NAME}" == fix-* ]]; then
|
|
should_push="true"
|
|
fi
|
|
fi
|
|
|
|
echo "should-push=${should_push}"
|
|
echo "should-push=${should_push}" >> $GITHUB_OUTPUT
|
|
|
|
# push-external: Should we also push to Docker Hub and Quay.io?
|
|
# Only for main repo on dev/beta branches or version tags
|
|
push_external="false"
|
|
if [[ "${should_push}" == "true" && "${{ github.repository_owner }}" == "paperless-ngx" ]]; then
|
|
case "${REF_NAME}" in
|
|
dev|beta)
|
|
push_external="true"
|
|
;;
|
|
esac
|
|
case "${GITHUB_REF}" in
|
|
refs/tags/v*|*beta.rc*)
|
|
push_external="true"
|
|
;;
|
|
esac
|
|
fi
|
|
echo "push-external=${push_external}"
|
|
echo "push-external=${push_external}" >> $GITHUB_OUTPUT
|
|
- name: Set repository name
|
|
id: repo
|
|
run: |
|
|
repo_name="${{ github.repository }}"
|
|
repo_name="${repo_name,,}"
|
|
|
|
echo "repository=${repo_name}"
|
|
echo "name=${repo_name}" >> $GITHUB_OUTPUT
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Maximize space
|
|
run: |
|
|
sudo rm -rf /usr/share/dotnet
|
|
sudo rm -rf /opt/ghc
|
|
sudo rm -rf /usr/local/share/boost
|
|
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
|
|
- name: Docker metadata
|
|
id: docker-meta
|
|
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=raw,value=${{ steps.ref.outputs.name }},enable=${{ github.event_name == 'pull_request' }}
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
- name: Build and push by digest
|
|
id: build
|
|
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0
|
|
with:
|
|
context: .
|
|
file: ./Dockerfile
|
|
platforms: ${{ matrix.platform }}
|
|
labels: ${{ steps.docker-meta.outputs.labels }}
|
|
build-args: |
|
|
PNGX_TAG_VERSION=${{ steps.docker-meta.outputs.version }}
|
|
outputs: type=image,name=${{ env.REGISTRY }}/${{ steps.repo.outputs.name }},push-by-digest=true,name-canonical=true,push=${{ steps.check-push.outputs.should-push }}
|
|
cache-from: |
|
|
type=registry,ref=${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}/cache/app:${{ steps.ref.outputs.name }}-${{ matrix.arch }}
|
|
type=registry,ref=${{ env.REGISTRY }}/${{ steps.repo.outputs.name }}/cache/app:dev-${{ matrix.arch }}
|
|
cache-to: ${{ steps.check-push.outputs.should-push == 'true' && format('type=registry,mode=max,ref={0}/{1}/cache/app:{2}-{3}', env.REGISTRY, steps.repo.outputs.name, steps.ref.outputs.name, matrix.arch) || '' }}
|
|
- name: Export digest
|
|
if: steps.check-push.outputs.should-push == 'true'
|
|
run: |
|
|
mkdir -p /tmp/digests
|
|
digest="${{ steps.build.outputs.digest }}"
|
|
echo "digest=${digest}"
|
|
echo "${digest}" > "/tmp/digests/digest-${{ matrix.arch }}.txt"
|
|
- name: Upload digest
|
|
if: steps.check-push.outputs.should-push == 'true'
|
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
with:
|
|
name: digests-${{ matrix.arch }}
|
|
path: /tmp/digests/digest-${{ matrix.arch }}.txt
|
|
if-no-files-found: error
|
|
retention-days: 1
|
|
archive: false
|
|
merge-and-push:
|
|
name: Merge and Push Manifest
|
|
runs-on: ubuntu-26.04
|
|
needs: build-arch
|
|
if: needs.build-arch.outputs.should-push == 'true'
|
|
environment: image-publishing
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
steps:
|
|
- name: Download digests
|
|
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
with:
|
|
path: /tmp/digests
|
|
pattern: digest-*.txt
|
|
merge-multiple: true
|
|
- name: List digests
|
|
run: |
|
|
echo "Downloaded digests:"
|
|
ls -la /tmp/digests/
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
|
|
with:
|
|
registry: ${{ env.REGISTRY }}
|
|
username: ${{ github.actor }}
|
|
password: ${{ secrets.GITHUB_TOKEN }}
|
|
- name: Login to Docker Hub
|
|
if: needs.build-arch.outputs.push-external == 'true'
|
|
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
- name: Login to Quay.io
|
|
if: needs.build-arch.outputs.push-external == 'true'
|
|
uses: docker/login-action@81c6f93d4bc991e510b342a00b419b3bb4efc5c6 # v4.7.0
|
|
with:
|
|
registry: quay.io
|
|
username: ${{ secrets.QUAY_USERNAME }}
|
|
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
|
|
- name: Docker metadata
|
|
id: docker-meta
|
|
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
|
|
with:
|
|
images: |
|
|
${{ env.REGISTRY }}/${{ needs.build-arch.outputs.repository }}
|
|
tags: |
|
|
type=ref,event=branch
|
|
type=raw,value=${{ needs.build-arch.outputs.ref-name }},enable=${{ github.event_name == 'pull_request' }}
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
- name: Create manifest list and push
|
|
working-directory: /tmp/digests
|
|
env:
|
|
REPOSITORY: ${{ needs.build-arch.outputs.repository }}
|
|
run: |
|
|
tags=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "${DOCKER_METADATA_OUTPUT_JSON}")
|
|
|
|
digests=""
|
|
for digest_file in digest-*.txt; do
|
|
digest=$(cat "${digest_file}")
|
|
digests+="${{ env.REGISTRY }}/${REPOSITORY}@${digest} "
|
|
done
|
|
|
|
echo "Creating manifest with tags: ${tags}"
|
|
echo "From digests: ${digests}"
|
|
|
|
docker buildx imagetools create ${tags} ${digests}
|
|
- name: Inspect image
|
|
env:
|
|
FIRST_TAG: ${{ fromJSON(steps.docker-meta.outputs.json).tags[0] }}
|
|
run: |
|
|
docker buildx imagetools inspect "${FIRST_TAG}"
|
|
- name: Copy to Docker Hub
|
|
if: needs.build-arch.outputs.push-external == 'true'
|
|
env:
|
|
TAGS: ${{ steps.docker-meta.outputs.tags }}
|
|
GHCR_REPO: ${{ env.REGISTRY }}/${{ needs.build-arch.outputs.repository }}
|
|
run: |
|
|
for tag in ${TAGS}; do
|
|
dockerhub_tag="${tag/${GHCR_REPO}/docker.io/paperlessngx/paperless-ngx}"
|
|
echo "Copying ${tag} to ${dockerhub_tag}"
|
|
skopeo copy --all "docker://${tag}" "docker://${dockerhub_tag}"
|
|
done
|
|
- name: Copy to Quay.io
|
|
if: needs.build-arch.outputs.push-external == 'true'
|
|
env:
|
|
TAGS: ${{ steps.docker-meta.outputs.tags }}
|
|
GHCR_REPO: ${{ env.REGISTRY }}/${{ needs.build-arch.outputs.repository }}
|
|
run: |
|
|
for tag in ${TAGS}; do
|
|
quay_tag="${tag/${GHCR_REPO}/quay.io/paperlessngx/paperless-ngx}"
|
|
echo "Copying ${tag} to ${quay_tag}"
|
|
skopeo copy --all "docker://${tag}" "docker://${quay_tag}"
|
|
done
|