Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# - Using composite action to avoid code duplication
name: Build and Deploy

env:
PDF_NAME: "ZhifanChen.pdf"

on:
push:
branches:
Expand Down Expand Up @@ -49,7 +52,7 @@ jobs:
- name: Set CV_LOCATION environment variable
run: |
TAG_NAME=${GITHUB_REF_NAME#refs/tags/}
PDF_URL="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG_NAME}/cv.pdf"
PDF_URL="https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAG_NAME}/${PDF_NAME}"
echo "CV_LOCATION=$PDF_URL" >> $GITHUB_ENV

- uses: ./.github/actions/build-with-cv
Expand Down Expand Up @@ -93,8 +96,8 @@ jobs:
- name: Upload CV Artifact
uses: actions/upload-artifact@v4
with:
name: cv
path: ./cv.pdf
name: ${{ env.PDF_NAME }}
path: ${{ env.PDF_NAME }}

deploy-cv:
needs: build-cv
Expand All @@ -106,15 +109,15 @@ jobs:
- name: Download CV Artifact
uses: actions/download-artifact@v4
with:
name: cv
name: ${{ env.PDF_NAME }}
path: .

- name: Upload PDF as Release Asset
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
files: ./cv.pdf
files: ${{ env.PDF_NAME }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand Down
5 changes: 2 additions & 3 deletions scripts/node/export-pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ console.log('Exporting cv.pdf...')
waitUntil: 'networkidle0',
})
await page.pdf({
path: './cv.pdf',
path: 'ZhifanChen.pdf',
format: 'A4',
displayHeaderFooter: false,
printBackground: true,
})
await browser.close()
console.log('PDF exported to dist/cv.pdf')
console.log('PDF exported to ZhifanChen.pdf')
})()

Loading