forked from kelvintaywl/resume
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.71 KB
/
publish.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
name: Publish resume in JSONResume format as Github Page
# Controls when the action will run.
on:
push:
branches: [ master, main ]
paths:
- "resume.json"
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
check_run:
runs-on: ubuntu-latest
if: "! contains(github.event.head_commit.message, '[ci skip]')"
steps:
- run: echo "${{ github.event.head_commit.message }}"
build:
runs-on: ubuntu-latest
needs: check_run
steps:
- uses: actions/checkout@v4
- uses: kelvintaywl/action-jsonresume-export@v1
name: Export resume as HTML
with:
theme: elegant
resume_filepath: resume.json
# modifies the index.html in-place
output_filepath: docs/index.html
- name: Commit published HTML
id: commit
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
if [ -n "$(git status --porcelain docs/index.html)" ]; then
git add docs/index.html
git commit -m "[ci skip] chore(docs/index.html): update resume page"
echo ::set-output name=exit_code::0
else
echo ::set-output name=exit_code::1
fi
- name: Push changes
uses: ad-m/github-push-action@master
if: steps.commit.outputs.exit_code == 0
with:
github_token: ${{ secrets.GH_TOKEN }}
branch: ${{ github.ref }}
- name: Update Gist
uses: exuanbo/actions-deploy-gist@v1
with:
token: ${{ secrets.GH_TOKEN }}
gist_id: 184483339270e7e76ecc72734c7f5d21
file_path: resume.json
file_type: text