|
1 | | -# azure-blobs-content-uploader |
| 1 | +# Azure blobs - content uploader |
| 2 | + |
| 3 | +Azure Blobs Content Uploader is designed as a github action, to help developers upload their build artifacts to *multiple* az-storage accounts, taking into account the absolute paths / relative paths / recursive structure from your file system. |
| 4 | + |
| 5 | +It's especially meant to help with SPA developers (ex: artifacts of create-react-app) to quickly upload artifacts to a lot of storage accounts for redundancy and performance. |
| 6 | + |
| 7 | +## Configuration details |
| 8 | + |
| 9 | +To configure this job, you'll need a few things. |
| 10 | + |
| 11 | +### Azure blob details |
| 12 | +The content uploader supports uploading to multiple storage accounts, so you're going to need the *connection strings* of all the blob storages that you want to upload the files to. |
| 13 | + |
| 14 | +```yaml |
| 15 | + - name: Upload Static Content |
| 16 | + uses: armhil/azure-blobs-content-uploader@1.0.0 |
| 17 | + with: |
| 18 | + azureBlobConfiguration: ${{ secrets.AZ_BLOB_CONFIGURATION }} # could be any secret that you have, see below for the format |
| 19 | + directoriesToUpload: '[{"path": "test/integrationtest-directory", "shouldRecurse": "true" }]' |
| 20 | +``` |
| 21 | +
|
| 22 | +You should use the below format for the `azureBlobConfiguration` parameter and this value should come from the secrets. **azureBlobConfiguration parameter is expected to contain the connection strings to blob storage accounts, so it's incredibly important to store it in github repository secrets, rather than some plaintext mechanism**. |
| 23 | + |
| 24 | +```javascript |
| 25 | +// Secret value schema |
| 26 | +[ |
| 27 | + { |
| 28 | + "connectionString": string, // Az Blobs connection string |
| 29 | + "container": string, // Container to upload the files to |
| 30 | + "path" : string // Path in the container that the files will get uploaded to |
| 31 | + }, |
| 32 | +] |
| 33 | +
|
| 34 | +// Example secret value |
| 35 | +[{"connectionString": "DefaultEndpointsProtocol=https;AccountName=azblobuploadtest;AccountKey=someAccountKeyNotReal;EndpointSuffix=core.windows.net |
| 36 | +", "container": "$web", "path": "" }] |
| 37 | +``` |
| 38 | + |
| 39 | +*Hint*: If you're uploading some static content for web-apps (like artifacts of create-react-app) - you can use the `$web` container from Azure Blob Storage. |
0 commit comments