-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,440 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
max_line_length = 80 | ||
indent_size = 2 | ||
tab_width = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
VITE_BASE_URL="/" | ||
VITE_APP_TITLE="Flip Forge" | ||
VITE_BACKGROUND_COLOR="#000000" | ||
VITE_TOOLBAR_COLOR="#ffffff" | ||
VITE_PAGE_NUMBER="60" | ||
VITE_FILE_DOWNLOAD="book.pdf" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Deploy test | ||
on: | ||
workflow_dispatch: | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./ | ||
with: | ||
file: test/lorem_ipsum.pdf | ||
title: "LOREM IPSUM" | ||
- name: Upload artifact | ||
id: deployment | ||
uses: actions/upload-pages-artifact@v3 | ||
with: | ||
path: dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
.DS_Store | ||
dist | ||
dist-ssr | ||
coverage | ||
*.local | ||
|
||
/cypress/videos/ | ||
/cypress/screenshots/ | ||
|
||
# Editor directories and files | ||
.vscode/settings.json | ||
!.vscode/extensions.json | ||
.idea | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
*.tsbuildinfo | ||
.tmp | ||
.book.pdf | ||
public | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
## v1.0.0 | ||
|
||
Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# build-flip-forge | ||
|
||
Build a static page with flip-forge from a PDF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: "deploy-flip-forge" | ||
branding: | ||
icon: book-open | ||
color: purple | ||
description: "Deploy flip forge on GitHub pages" | ||
|
||
inputs: | ||
file: | ||
description: "PDF file to convert." | ||
required: true | ||
title: | ||
description: "Page title" | ||
required: false | ||
default: "Flip forge" | ||
backgroundColor: | ||
description: "Background color" | ||
required: false | ||
default: "#000000" | ||
toolbarColor: | ||
description: "Toolbar color" | ||
required: false | ||
default: "#ffffff" | ||
baseUrl: | ||
description: "Base URL of the app" | ||
required: false | ||
default: "/" | ||
outputs: | ||
dist: | ||
description: "Dist folder" | ||
value: ${{ steps.dist.outputs.dist }} | ||
|
||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: "Install poppler" | ||
shell: bash | ||
run: | | ||
sudo apt update -y | ||
sudo apt install -y poppler-utils | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20.x" | ||
cache: "npm" | ||
- name: "Install dependencies" | ||
run: | | ||
npm ci | ||
- name: "Convert to images" | ||
shell: bash | ||
env: | ||
INPUT_FILE: ${{ inputs.file }} | ||
run: | | ||
mkdir public | ||
cp "$INPUT_FILE" public/ | ||
pdftocairo "$INPUT_FILE" -jpeg public/page | ||
- name: "Build site" | ||
env: | ||
INPUT_FILE: ${{ inputs.file }} | ||
VITE_BASE_URL: ${{ inputs.baseUrl }} | ||
VITE_APP_TITLE: ${{ inputs.title }} | ||
VITE_BACKGROUND_COLOR: ${{ inputs.backgroundColor }} | ||
VITE_TOOLBAR_COLOR: ${{ inputs.toolbarColor }} | ||
shell: bash | ||
run: | | ||
export VITE_PAGE_NUMBER="$(ls -1 public/ | wc -l)" | ||
export VITE_FILE_DOWNLOAD=$(basename "$INPUT_FILE") | ||
npm run build | ||
- name: Set dist folder | ||
id: dist | ||
shell: bash | ||
run: echo "dist=$(realpath dist)" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"action": "workflow_dispatch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!DOCTYPE html> | ||
<html lang=""> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>%VITE_APP_TITLE%</title> | ||
</head> | ||
<body style="background-color: %VITE_BACKGROUND_COLOR%"> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"paths": { | ||
"@/*": ["./src/*"] | ||
} | ||
}, | ||
"exclude": ["node_modules", "dist"] | ||
} |
Oops, something went wrong.