-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
62 lines (56 loc) · 1.89 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: 'Markdown to PDF & Upload Action'
description: 'Generate PDF with ruby gem md-to-pdf and upload to Nextcloud'
author: opf
branding:
icon: "book"
color: "purple"
inputs:
config:
description: "Config file"
required: true
default: "md-to-pdf.config.yml"
stylings:
description: "Folder with md-to-pdf stylings"
required: true
default: "./stylings"
nextcloud-user:
description: "Nextcloud username"
required: false
nextcloud-app-access-key:
description: "Nextcloud app access key"
required: false
nextcloud-upload-path:
description: "Nextcloud host path (e.g. https://nextcloud.example.com/remote.php/dav/files/pdf-bot-user/some-example-path/upload-folder )"
required: false
runs:
using: "composite"
steps:
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: ${{ github.action_path }}
# We need to copy md2pdfup's package-lock.json into the workspace
# because hashFiles only works on files inside the workspace.
- run: cp ${{ github.action_path }}/package-lock.json md2pdfup-package-lock.json
shell: bash
- uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "npm"
cache-dependency-path: '**/md2pdfup-package-lock.json'
- run: |
npm install
echo "node_modules/.bin" >> "$GITHUB_PATH"
shell: bash
working-directory: ${{ github.action_path }}
- run: |
bundle exec ruby entrypoint.rb
working-directory: ${{ github.action_path }}
shell: bash
env:
MD2PDF_WORK_DIR: ${{ github.workspace }}
MD2PDF_CONFIG_FILE: ${{ inputs.config }}
MD2PDF_STYLING_DIR: ${{ inputs.stylings }}
NEXTCLOUD_USERNAME: ${{ inputs.nextcloud-user }}
NEXTCLOUD_APP_ACCESS_KEY: ${{ inputs.nextcloud-app-access-key }}
NEXTCLOUD_UPLOAD_PATH: ${{ inputs.nextcloud-upload-path }}