-
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.
added github action for remote building
- Loading branch information
1 parent
4d15467
commit 6109456
Showing
3 changed files
with
61 additions
and
3 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,36 @@ | ||
name: Generate PDF from Markdown | ||
|
||
on: | ||
push: | ||
paths: | ||
- '**/*.md' # Trigger this workflow on Markdown file changes | ||
workflow_dispatch: # Allows manual trigger of the action | ||
|
||
jobs: | ||
generate-pdf: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install mdpdf | ||
run: npm install -g mdpdf | ||
|
||
- name: Generate PDF | ||
run: mdpdf cv.md --style=styles.css --border-top=12mm --border-bottom=0mm --border-left=4mm --border-right=4mm | ||
|
||
- name: Commit and push PDF | ||
run: | | ||
git config --global user.name 'github-actions[bot]' | ||
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | ||
git add cv.pdf | ||
git commit -m 'Generate PDF from Markdown' | ||
git push | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication |
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,18 @@ | ||
# Ignore node_modules directory | ||
node_modules/ | ||
|
||
# Ignore log files | ||
*.log | ||
|
||
# Ignore build directories | ||
dist/ | ||
build/ | ||
|
||
# Ignore OS-specific files | ||
.DS_Store | ||
|
||
# Ignore environment variable files | ||
.env | ||
|
||
# Ignore IDE-specific files | ||
.vscode/ |
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,12 +1,16 @@ | ||
## Installation | ||
By default, changes to the markdown file in this repository trigger a github action that builds a pdf from the markdown source and commits the file. | ||
|
||
To enable the comitting of this file back to this repository click on Settings > Actions > General and (under workflow permissions) select "Read and write permissions" & "Allow GitHub Actions to create and approve pull requests". | ||
|
||
```bash | ||
# Run Locally | ||
# Install mdpdf glboally | ||
# or run locally: | ||
|
||
# Install mdpdf globally | ||
npm install -g [email protected] | ||
|
||
# Build pdf from markdown locally | ||
mdpdf cv.md --style=styles.css --border-top=12mm --border-bottom=1mm --border-left=4mm --border-right=4mm | ||
mdpdf cv.md --style=styles.css --border-top=12mm --border-bottom=0mm --border-left=4mm --border-right=4mm | ||
``` | ||
|
||
### About | ||
|