Skip to content

Compile and Publish Resume #35

Compile and Publish Resume

Compile and Publish Resume #35

Workflow file for this run

name: Compile and Publish Resume
on:
push:
branches:
- 'two-pages'
env:
resume-file: resume.pdf
artifact-id: resume
jobs:
build:
runs-on: ubuntu-latest
env:
node-version: 22
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
cache: yarn
- name: Webpack build
run: |
yarn install
npx webpack --mode production --env HYPHENATE=no --env OUTPUT=${{ env.resume-file }}
- name: Upload resume artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.artifact-id }}
path: dist/${{ env.resume-file }}
deploy:
runs-on: ubuntu-latest
needs: build
steps:
- name: Download resume artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.artifact-id }}
- name: Create minimalistic index.html
run: |
cat << EOF > index.html
<meta http-equiv="refresh" content="0; URL=./${{ env.resume-file }}">
EOF
- name: Compute short SHA
run: echo SHORT_SHA=`echo ${GITHUB_SHA::7}` >> $GITHUB_ENV
# - name: Deploy to GitHub Pages
# # TODO: Consider using the official `deploy-pages` and `upload-pages-artifact` GitHub Actions
# uses: peaceiris/actions-gh-pages@v3
# with:
# publish_dir: .
# github_token: ${{ secrets.GITHUB_TOKEN }}
# full_commit_message: Redeploy for ${{ env.SHORT_SHA }}