Github action to upload blob to azure storage
MIT License
This GitHub Action (written in JavaScript) wraps the Azure Storage Blob NPM Package to allow you to upload file to azure storage blob in workflow.
Create a workflow .yml
file in your .github/workflows
directory. An example workflow is available below.
Also, you might want to get your storage account key in azure portal, and put it in your repository secrets section
account
: The azure storage account namecontainer
: The container in provided azure storagedirectory
: The directory containing your files to upload to azure storage container.This workflow will readdir
to your input directory
, and it will upload all the file with its original name to the azure storage container. It will skip the directory inside the directory. So, no nested upload supported now.
If you really want something like glob pattern matching to supporte nested file scan. Let me know or make the PR.
AZURE_ACCOUNT_KEY
: You azure storage account key. You can found this in Access keys
page of your storage account.If this is not provided, it will use AnonymousCredential
On every push
.
on:
push:
name: Build
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build
runs: |
npm run build
- name: Upload to azure
uses: ci010/upload-blob-to-azure@master
with:
account: your-storage-account
container: the-container-to-upload
directory: ./build
env:
AZURE_ACCOUNT_KEY: ${{ secrets.AZURE_ACCOUNT_KEY }}
This will upload all the files under ./build
directory under your repository. It will skip to dive into the nested directory.
Feel free to contribute. PRs are welcomed.
The scripts and documentation in this project are released under the MIT License