Skip to content

Commit

Permalink
Create github actions for resume (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
eerison authored Mar 20, 2023
1 parent f4751ab commit d6aa789
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/resume.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Resume

on:
discussion:
types: [ created, edited ]
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 19

- name: cache
id: cache-frontend
uses: actions/cache@v3
with:
key: frontend-${{ hashFiles('**/package-lock.json') }}
path: |
node_modules
.cache
restore-keys: |
frontend-
- run: npm install

pdf:
runs-on: ubuntu-latest
needs: build
name: Generate pdf
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 19

- uses: actions/cache@v3
with:
key: frontend-${{ hashFiles('**/package-lock.json') }}
path: |
node_modules
.cache
restore-keys: |
frontend-
- run: npm run node:group:init
- run: npm run build

- name: Generate pdf
run: |
python3 -m http.server --directory dist &> /dev/null &
pid=$!
sleep 1
npm run node:generate:pdf
kill "${pid}"
- name: Save resume pdf
uses: actions/upload-artifact@v3
with:
name: resume
retention-days: 10
path: data/pdf/resume.pdf
2 changes: 1 addition & 1 deletion node/pdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ function getPage(page: Page, __dirname: string) {
})
}

return page.goto('http://localhost:3000/');
return page.goto('http://localhost:8000/');
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"private": false,
"type": "module",
"scripts": {
"dev": "npm run node:generate:json && vite --host 0.0.0.0 --port 3000",
"dev": "npm run node:generate:json && vite --host 0.0.0.0 --port 8000",
"build": "tsc && vite build",
"preview": "vite preview",
"node:copy-data": "cp data/data.yaml.dist data/data.yaml",
Expand Down

0 comments on commit d6aa789

Please sign in to comment.