GithubHelp home page GithubHelp logo

ashuvssut / generatepdf-gha Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 2.0 28.37 MB

This GitHub Action is used by me to generate my Resume PDF using web-scraping (puppeteer) and then update my Resume pdf present in the Resume Repository.

License: MIT License

JavaScript 100.00%
puppeteer-pdf-generator github-actions nodejs

generatepdf-gha's Introduction

generatePdf-GHA

This GitHub Action is used by me to generate my Resume PDF using web-scraping (puppeteer) and then update my Resume pdf present in the Resume Repository. After Updating my Resume PDF, I can share my Resume PDF to anyone.

This GitHub action will work everytime I update and push my Resume to my Resume Repository.

The workflow.yml file I use in Resume Repo:

name: GeneratePDF

on:
  push:
    branches:
      - main

jobs:
  generate_pdf:
    runs-on: ubuntu-latest

    steps:
      - name: Use Node.js v15.x
        uses: actions/setup-node@v2
        with:
          node-version: 15.x

      - name: Generate PDF Action
        uses: ashuvssut/generatePdf-GHA@v1
        with:
          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

As of now, this Action can't be used by other people. But to use this action to generate you own PDF, you need to fork this, edit four variables present in src/action.js. Those four variables are:

  • OWNER
  • REPO
  • BRANCH
  • PDF_PATH

after doing this, you have created your own action that only works for your repo.

I am really sorry I was very lazy to put code to get these variable automatically and through workflow env variables.

If you want to contribute to this issue: It is very easy:

  • use @action/core for OWNER and REPO variables
  • we can use workflow env variables for BRANCH and PDF_PATH variables

Make the PR! I will be ready to help you out if you get stuck :)

Thankyou for reading this out!

generatepdf-gha's People

Contributors

ashuvssut avatar

Stargazers

 avatar  avatar

Watchers

 avatar

generatepdf-gha's Issues

add node_modules to the repo (for ubuntu users only)

I need to push node_modules to this repository from a ubuntu OS machine

Prerequisites for this issue:

If you satisfy the above prerequisites then follow the Steps given below

  • open terminal in the project directory in your computer
  • run $ npm install
  • open .gitignore file, delete the line node_modules
  • configure Git LFS in your current repository using the following command
    $ git lfs install
  • there are total of 2 large files (total 300mb) in your node_modules folder that needs tracked using git LFS. Use the following command
    git lfs track $(find ./ -type f -size +100M)
  • now its time to push everything to your forked repo
  • now make a PR

Please mention you doubts below If you need help with this

Provide Variables values via workflow file and @action/core package to src/action.js

For now, this Action can't be used by other people. To use this action to generate their own PDF, they need to fork this repo, edit four variables present in src/action.js.

Those four variables are:

  • OWNER
  • REPO
  • BRANCH
  • PDF_PATH

after doing this, they have created their own action that only works for their repo.


SOLUTION TO AVOID THIS OVERHEAD and make this Action reusable by everyone:
we can modify action.js any action.yml to fetch the values to feed in these variables
form the workflow file, and from the @action/core package's functions

  • use @action/core for OWNER and REPO variables
  • we can use workflow env variables for BRANCH and PDF_PATH variables

If you want to contribute, I will be there to help you out if you get stuck :) Happy Learning!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.