Skip to content

Commit

Permalink
feat: set up Github Action (container action)
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvintaywl committed Jan 2, 2021
0 parents commit 2c7edf1
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM node:12

# do not require puppeteer download of Chronium;
# resume-cli uses puppeteer for PDF export, which we do not use.
ENV PUPPETEER_SKIP_DOWNLOAD=1

LABEL repository="https://github.com/kelvintaywl/jsonresume-github-page"
LABEL homepage="https://github.com/kelvintaywl/jsonresume-github-page"
LABEL maintainer="Kelvin Tay <[email protected]>"

RUN npm install -g [email protected]
COPY entrypoint.sh /entrypoint.sh

ENTRYPOINT ["/entrypoint.sh"]
32 changes: 32 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# action.yml
name: 'JSONResume Export'
description: 'Simple GitHub Action to export your JSONResume'
branding:
icon: 'printer'
color: 'yellow'
inputs:
theme:
description: |
JSONResume theme name.
Assumes the theme package would be found
as `jsonresume-theme-{theme}` in NPM.
You can search for themes at https://npmsearch.com/?q=jsonresume-theme
required: true
default: 'flat'
resume_filepath:
description: |
File path of the resume in JSONResume format
required: false
default: 'resume.json'
output_filepath:
description: |
Output file path for exported HTML file.
required: false
default: 'index.html'
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.theme }}
- ${{ inputs.resume_filepath }}
- ${{ inputs.output_filepath }}
13 changes: 13 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh -l

THEME=${1}
RESUME=${2}
OUTPUT=${3}

THEME_PACKAGE=jsonresume-theme-${THEME}
echo "Installing theme: ${THEME}"

# NOTE: this needs to be installed locally, not globally
npm install ${THEME_PACKAGE}

resume export --resume ${RESUME} --theme ${THEME} --format html ${OUTPUT}

0 comments on commit 2c7edf1

Please sign in to comment.