A sample of converting Markdown to PDF and deploying to Google Drive with CircleCI 2.0
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.circleci
css
src
.gitignore
LICENSE
README.md
package.json

README.md

markdown-pdf-googledrive-ci-sample

A sample of converting Markdown to PDF and deploying to Google Drive with CircleCI 2.0

Mechanism

Preparing

1. Create a Service Account

  1. Go to Google API Console
  2. Create a new Service Account in some project
  3. Download the credential json file

2. Register the credential of Service Account as an envvar on CircleCI

  1. Make the credential json "one line" and copy it
  2. Go to https://circleci.com/gh/{user}/{project}/edit#env-vars and add the copied credential as a new envvar named GOOGLE_SERVICE_ACCOUNT_CREDENTIAL image

3. Allow the Service Account to access the target folder on Google Drive

  1. Show the email address of the Service Account and copy it image
  2. Share the target folder to the Service Account with "edit" access, and copy the folder id image
  3. Replace parent_folder_id_here of .circleci/config.yml with the copied folder id

Notes

gdrive's Service Account feature is not released as binary yet so currently we needs to compile it from source.

But after gdrive v2.2.0 was released we should be able to simply download official binary. Then you can use .circleci/config.gdrive220.yml.

Of course you have to replace download url and shasum in the file and rename the file to config.yml.

Result example

image