forked from eralpkaraduman/cv
-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (69 loc) · 2.55 KB
/
deploy.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
63
64
65
66
67
68
69
70
71
72
73
74
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Ruby
on:
push:
branches: [ gh-pages ]
pull_request:
branches: [ gh-pages ]
jobs:
build-pdf:
env:
DISPLAY: :0
INJECT_CV_DOWNLOAD_LINK: NO
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5.1
bundler-cache: false
- name: Set build name env
id: build-name
run: |
echo "::set-output name=value::v$(date +%s)"
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Start xvfb
run: |
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 &
- name: Apt update
run: sudo apt-get -qq update
- name: Install xfonts
run: sudo apt-get install -y xfonts-75dpi
- name: Install wkhtmltox
run: |
wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.focal_amd64.deb
sudo apt install ./wkhtmltox_0.12.6-1.focal_amd64.deb
- name: Bundle Install
run: bundle install
- name: Install pdfkit
run: gem install pdfkit
- name: Build jekyll
run: bundle exec jekyll build
- name: Generate pdf
run: ruby make_pdf.rb
- name: Bump version and push tag
uses: hole19/git-tag-action@master
env:
TAG: ${{ steps.build-name.outputs.value }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Make release
uses: softprops/action-gh-release@v1
with:
name: ${{ steps.build-name.outputs.value }}
tag_name: ${{ steps.build-name.outputs.value }}
files: |
./_site/cv.pdf