Closed mruknowme closed 3 years ago
You can provide the —destination-path flag as part of the extra_flags
field. Enabling the sync
flag will purge the entire container which might not be what you’re looking for, but is one option.
if you’re referring to the source directory, you can use the —pattern flag to filter certain files or file extensions.
Let me know what you come up with.
Perfect, thanks, will try in a moment and let you know here :)
@bacongobbler sorry if it's a dumb question.. I added this line to my yml file extra_flags: --destination-path test
but after completing the job it still seem to upload to root directory.
According to guide, from what I understand, just specifying folder name should work: https://docs.microsoft.com/en-us/cli/azure/ext/storage-preview/storage/blob/directory?view=azure-cli-latest
Do you know what could be the issue?
Thanks
Can you share an example or a link to your workflow YAML?
name: Upload To Azure Blob Storage
on:
push:
branches:
- master
jobs:
upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '15'
- run: npm install
- run: npm run build
- uses: bacongobbler/azure-blob-storage-upload@v1.1.1
with:
source_dir: 'dist'
container_name: '$web'
connection_string: ${{ secrets.ConnectionString }}
sync: true
extra_flags: --destination-path test
Try wrapping the arguments in double quotes. I have a working example here that you can reference against: https://github.com/fishworks/gofish/blob/main/.github/workflows/build.yml#L84
Ah, yep, not only I missed quotes but for some reason I used extra_flags
instead of extra_args
all working well now, thank you!
Ah, that’s my fault. I referenced it as extra_flags in my first comment. Apologies.
Glad you found a solution! Happy holidays
Is it possible to upload to a specific folder on the blob and clean the folder before upload?
Thanks