Update main.yml #23
Workflow file for this run
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
# example GitHub workflow | |
name: Publish resume in JSONResume format as Github Page | |
on: | |
push: | |
branches: [ master, test/* ] | |
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 | |
- name: checkout gh pages branch | |
uses: actions/checkout@v4 | |
if: always() | |
continue-on-error: true | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- uses: kelvintaywl/action-jsonresume-export@v1 | |
name: Export resume as HTML | |
with: | |
theme: macchiato | |
resume_filepath: resume.json | |
# modifies the index.html in-place | |
output_filepath: gh-pages/index.html | |
- name: Commit published HTML | |
id: commit | |
run: | | |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)" | |
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)" | |
if [ -n "$(git status --porcelain index.html)" ]; then | |
git add index.html | |
git commit -m "[ci skip] chore(docs/index.html): update resume page" | |
echo "exit_code=0" >> $GITHUB_OUTPUT | |
else | |
echo "exit_code=1" >> $GITHUB_OUTPUT | |
fi | |
- name: Push changes | |
working-directory: gh-pages | |
if: steps.commit.outputs.exit_code == 0 | |
run: | | |
git push origin gh-pages |