Loading repository data…
Loading repository data…
dartilesm / repository
Automates the process of uploading files or folders to Vercel Blob Storage during CI/CD workflows. It supports both single and recursive directory uploads, making it useful for deploying assets, backups, or build artifacts to Vercel Blob.
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
This GitHub Action allows you to upload files or entire folders to Vercel Blob storage by specifying a source path and destination path. It provides an easy way to manage blob storage in your Vercel projects through GitHub Actions workflows.
sourceRequired The source path of the file or folder you want to upload to Vercel Blob storage.
destinationRequired The destination path where the file(s) should be stored in Vercel Blob storage.
read-write-tokenRequired Your Vercel Blob read-write token (BLOB_READ_WRITE_TOKEN). This should be stored as a GitHub secret for security.
This action does not provide any outputs for privacy and security reasons. To access your uploaded files, check your Vercel dashboard under Storage → Blob.
This action requires a Vercel Blob read-write token. The action will automatically set the BLOB_READ_WRITE_TOKEN environment variable for the Vercel Blob SDK to use. You can obtain this token from your Vercel dashboard:
BLOB_READ_WRITE_TOKENUpload a single file to Vercel Blob storage:
name: Upload Single File
on:
push:
branches: [main]
jobs:
upload-file:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Upload file to Vercel Blob
uses: dartilesm/vercel-blob-action@v2
with:
source: "path/to/file.txt"
destination: "uploads/file.txt"
read-write-token: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
Upload an entire folder (including subdirectories) to Vercel Blob storage:
name: Upload Build Folder
on:
push:
branches: [main]
jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build project
run: |
# Your build commands here
mkdir -p dist/assets
echo "Main file" > dist/index.html
echo "Stylesheet" > dist/assets/style.css
echo "Script" > dist/assets/script.js
- name: Upload entire build folder to Vercel Blob
uses: dartilesm/vercel-blob-action@v2
with:
source: "dist/"
destination: "builds/${{ github.sha }}"
read-write-token: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
This will upload all files maintaining the folder structure:
dist/index.html → builds/{sha}/index.htmldist/assets/style.css → builds/{sha}/assets/style.cssdist/assets/script.js → builds/{sha}/assets/script.jsGet your Vercel Blob token:
BLOB_READ_WRITE_TOKENAdd the token to GitHub Secrets:
BLOB_READ_WRITE_TOKENThis action is built with TypeScript and uses a build process to bundle all dependencies into a single JavaScript file. This means consumers don't need to install dependencies when using the action.
Clone the repository:
git clone https://github.com/dartilesm/vercel-blob-action.git
cd vercel-blob-action
Install dependencies:
npm install
# or
bun install
The action uses TypeScript and needs to be built before it can be used:
npm run build
# or
bun run build
This command:
tsc)@vercel/nccdist/index.jssrc/index.tsNote: A pre-commit hook automatically runs npm run build and stages the built files, ensuring the dist/ directory is always in sync with your source code.
npm run build - Build the action for productionnpm run dev - Watch mode for development (TypeScript compilation only)├── src/
│ └── index.ts # Main action source code
├── dist/
│ ├── index.js # Built and bundled action (committed)
│ └── index.js.map # Source map for debugging
├── action.yml # Action metadata
├── package.json # Dependencies and scripts
└── tsconfig.json # TypeScript configuration
Note: The dist/ directory is committed to the repository because GitHub Actions need the built JavaScript file to run the action.
This project is licensed under the ISC License.