Skip to content

Commit

Permalink
Improve resume generate
Browse files Browse the repository at this point in the history
  • Loading branch information
eerison committed Mar 24, 2023
1 parent ba0571f commit 04b0899
Show file tree
Hide file tree
Showing 3 changed files with 1,583 additions and 45 deletions.
54 changes: 11 additions & 43 deletions .github/workflows/resume.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,12 @@ on:
types: [labeled]

jobs:
execute:
name: Initial checks
if: github.event_name == 'discussion' || github.event.label.name == 'template'
runs-on: ubuntu-latest
steps:
- run: echo "make github happy :)"

build:
name: Build
runs-on: ubuntu-latest
needs: execute
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:
resume:
runs-on: ubuntu-latest
needs: build
name: Generate pdf
if: github.event_name == 'discussion' || github.event.label.name == 'template'
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') }}
Expand All @@ -56,9 +22,13 @@ jobs:
restore-keys: |
frontend-
- run: npm install

# Process from discussion.
- name: Get content from discussion's description
if: github.event_name == 'discussion'
env:
SAVE_PATH: ${{github.actor}}/resume.pdf
uses: DamianReeves/write-file-action@master
with:
path: ./data/data.txt
Expand All @@ -71,6 +41,8 @@ jobs:
# Process from pull request.
- run: npm run node:copy-data
if: github.event_name == 'pull_request'
env:
SAVE_PATH: pull_request/resume_${{github.run_number}}.pdf

- run: npm run node:generate:json
- run: npm run build
Expand All @@ -84,11 +56,7 @@ jobs:
kill "${pid}"
- name: Upload resume to bucket
run: |
python -m pip install --upgrade pip
pip install awscli
aws s3 cp ./data/pdf s3://users/${{github.actor}} --endpoint-url ${{env.ENDPOINT_URL}} --recursive
run: npm run cloud:bucket:object put -- --file=data/pdf/resume_local.pdf myprofile/users/${{env.SAVE_PATH}}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.CLOUDFLARE_SECRET_ACCESS_KEY }}
ENDPOINT_URL: https://${{secrets.CLOUDFLARE_ACCOUNT_ID}}.r2.cloudflarestorage.com/myprofile
CLOUDFLARE_ACCOUNT_ID: ${{secrets.CLOUDFLARE_ACCOUNT_ID}}
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_ACCESS_KEY_ID }}
Loading

0 comments on commit 04b0899

Please sign in to comment.