Skip to content

Upload Resume PDF to Release #24

Upload Resume PDF to Release

Upload Resume PDF to Release #24

name: Upload Resume PDF to Release
on:
workflow_run:
workflows: ["Deploy to GitHub Pages"]
types:
- completed
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
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
page-ranges: 1
margin: "10mm"
format: "A4"
# 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 }}