Skip to content
This repository has been archived by the owner on Aug 27, 2023. It is now read-only.

Commit

Permalink
feature: add gh-pages deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasz.czaplinski committed Nov 18, 2019
1 parent bc97d3f commit 870b4d4
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,9 @@ jobs:
asset_path: ./target/dist/resume.pdf
asset_name: resume.pdf
asset_content_type: application/pdf

- name: Update gh-pages branch
run: |
lein gh-pages-export
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Change Log
All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/).

## [1.4.0] - 18.11.2019
### Added
- Script to export to gh-pages

## [1.3.3] - 17.11.2019
### Changed
- Updated skill section in PDF to be leaner.
Expand Down Expand Up @@ -37,6 +41,7 @@ All notable changes to this project will be documented in this file. This change
### Added
- Export to [json resume](jsonresume.org).

[1.4.0]: https://github.com/scoiatael/resume/compare/v1.3.3...v1.4.0
[1.3.3]: https://github.com/scoiatael/resume/compare/v1.3.2...v1.3.3
[1.3.2]: https://github.com/scoiatael/resume/compare/v1.3.1...v1.3.2
[1.3.1]: https://github.com/scoiatael/resume/compare/v1.3.0...v1.3.1
Expand Down
9 changes: 5 additions & 4 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(defproject resume "1.3.3"
:description "Resume-from-org generator"
:url "http://example.com/FIXME"
(defproject resume "1.4.0"
:description "Resume generator"
:url "http://github.com/scoiatael/resume"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
:dependencies [[org.clojure/clojure "1.10.0"]
Expand All @@ -11,7 +11,8 @@
[stasis "2.5.0"]]
:aliases {"export" ["run" "-m" "resume.core/export"]
"test" ["with-profile" "test" "midje"]
"docker-export" ["run" "-m" "resume.docker/export"]}
"docker-export" ["run" "-m" "resume.docker/export"]
"gh-pages-deploy" ["run" "-m" "resume.gh-pages/deploy"]}
:repl-options {:init-ns resume.core}
:ring {:handler resume.web/app}
:profiles {:dev {:plugins [[lein-ring "0.12.5"]]
Expand Down
2 changes: 1 addition & 1 deletion resources/templates/resume.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<title>{{resume.basics.name}}</title>

{% for path in css-paths %}
{% style path %}
<link href="{{ path }}" rel="stylesheet" type="text/css" />
{% endfor %}
<style type="text/css">
{{ css|safe }}
Expand Down
22 changes: 22 additions & 0 deletions src/resume/gh_pages.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
(ns resume.gh-pages
(:require [clojure.string :as str]
[clojure.java.shell :as shell]))


(defn- sh! [& args]
(let [cmd-result (apply shell/sh args)
{exit :exit
err :err} cmd-result]
(if (= 0 exit)
cmd-result
(throw (Exception. (str "invocation of '" args "' failed with " err))))))

(defn deploy
"Deploy current artifacts to gh-pages branch"
[]
(let [git-tag (-> (sh! "git" "describe" "--tags") :out str/trim)]
(sh! "git" "checkout" "gh-pages")
(sh! "mv" "target/dist/resume.html" "index.html")
(sh! "git" "add" "index.html")
(sh! "git" "commit" "-m" (str "release: " git-tag))
(sh! "git" "push" "origin" "gh-pages")))

0 comments on commit 870b4d4

Please sign in to comment.