Upload Resume PDF to Release #13
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: Upload Resume PDF to Release | |
on: | |
workflow_run: | |
workflows: ["Deploy to GitHub Pages"] | |
types: | |
- completed | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# Clone our repo | |
- name: Clone our repo | |
uses: actions/checkout@v4 | |
# Setup Webpage to PDF | |
- name: Setup webpage to pdf action | |
uses: lonewanderer27/puppeteer-pdf-action@master | |
with: | |
url: https://lonewanderer27.github.io/resume | |
output-file-path: Ian_James_Resume_GA.pdf | |
# Set the date and time in GMT+8 | |
- name: Get Date and Time in GMT+8 | |
id: get_datetime | |
run: | | |
# Set the timezone to Asia/Manila (GMT+8) | |
export TZ=Asia/Manila | |
# Format: YYYYMMDD-HHMMSS | |
TAG=$(date +"%Y%m%d-%H%M%S") | |
echo "Generated Tag in GMT+8: $TAG" | |
echo "::set-output name=tag::$TAG" | |
# Create a new tag | |
- name: Create a new tag | |
run: | | |
TAG=${{ steps.get_datetime.outputs.tag }} | |
echo "Creating tag $TAG..." | |
git tag $TAG | |
git push origin $TAG | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Upload new release using tag | |
- name: Upload new release using tag | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file: Ian_James_Resume_GA.pdf | |
asset_name: Ian_James_Resume_GA.pdf | |
overwrite: true | |
tag: ${{ steps.get_datetime.outputs.tag }} |