Add checking for changes on GH action run #5
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
name: Release | |
on: push | |
permissions: | |
contents: write | |
jobs: | |
changes: | |
runs-on: ubuntu-latest | |
outputs: | |
src: ${{ steps.changes.outputs.src }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
filters: | | |
src: | |
- 'src/**' | |
build: | |
needs: changes | |
if: ${{ needs.changes.outputs.src == 'true' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install typst | |
run: | | |
sudo snap install typst | |
- name: Compile typst | |
run: | | |
typst compile src/resume.typ --input title=${{ vars.TITLE }} --input author=${{ vars.AUTHOR }} --input email=${{ vars.EMAIL }} --input github=${{ vars.GITHUB }} --input linkedin=${{ vars.LINKEDIN }} --font-path=src/fonts resume.pdf | |
- name: Get tag name | |
id: tag-name | |
run: | | |
echo "tagname=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
- name: Upload doc | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
gh release create ${{ steps.tag-name.outputs.tagname }} -t "Resume" -n "Generated documents (${{ steps.tag-name.outputs.tagname }})" | |
gh release upload ${{ steps.tag-name.outputs.tagname }} resume.pdf |