Skip to content

Commit

Permalink
update version from tag, upload config.json to ftp
Browse files Browse the repository at this point in the history
  • Loading branch information
jozefbaranec committed Feb 7, 2025
1 parent df2a88e commit fb37e44
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build and Publish Docker Image

on:
push:
branches:
- master
# branches:
# - master
tags:
- 'v*.*.*' # Matches version tags like v1.0.0
workflow_dispatch:
Expand Down Expand Up @@ -82,3 +82,8 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
repository: ${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_HUB_REPOSITORY }}

- name: Upload to FTP
run: |
curl -T config.json ftp.pdfix.net/update-service/v1/actions/${{ env.DOCKER_HUB_NAMESPACE }}/${{ env.DOCKER_HUB_REPOSITORY }}/config.json --user "${{ secrets.FTP_USERNAME }}:${{ secrets.FTP_PASSWORD }}" --ftp-create-dirs
6 changes: 2 additions & 4 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
{
"version": "v0.0.0",
"actions": [
{
"title": "OCR Tesseract",
"name": "ocr_tesseract",
"desc": "A Docker image that adds an OCR text layer to scanned PDF files using PDFix SDK and Tesseract OCR",
"icon": "image_search",
"version": {
"major": 1,
"minor": 0
},
"version": "v0.0.0",
"category": "OCR",
"program": "docker run --platform linux/amd64 -v \"${working_directory}:/data\" --rm pdfix/ocr-tesseract:latest --name \"${license_name}\" --key \"${license_key}\" ocr -i \"/data/${input_pdf}\" -o \"/data/${output_pdf}\" --lang \"${language}\"",
"args": [
Expand Down
4 changes: 3 additions & 1 deletion update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ if [ ! -f "config.json" ]; then
exit 1
fi

# Replace "v0.0.0" placeholder with the provided argument in config.json
sed -i "s|v0.0.0|$1|g" config.json
# Replace "latest" with the provided argument in config.json
sed -i "s/latest/$1/g" config.json
sed -i "s|latest|$1|g" config.json

echo "Replaced all occurrences of 'latest' with '$1' in config.json."

0 comments on commit fb37e44

Please sign in to comment.