File tree 2 files changed +18
-8
lines changed
2 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -12,26 +12,33 @@ jobs:
12
12
- run : |
13
13
mkdir -p path/to/artifact1
14
14
mkdir -p path/to/artifact2
15
- echo hello > path/to/artifact1/world .txt
16
- echo hello > path/to/artifact2/world.txt
15
+ echo hello > path/to/artifact1/hello .txt
16
+ echo world > path/to/artifact2/world.txt
17
17
18
18
- name : Basic usage
19
19
uses : ./
20
20
with :
21
21
connection-string : ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
22
- name : ' azblob-upload-artifact '
22
+ name : ' azblob-upload-artifact1 '
23
23
path : ' README.md'
24
24
25
25
- name : Upload with path (file)
26
26
uses : ./
27
27
with :
28
28
connection-string : ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
29
- name : ' azblob-upload-artifact '
30
- path : ' path/to/artifact1/world .txt'
29
+ name : ' azblob-upload-artifact2 '
30
+ path : ' path/to/artifact1/hello .txt'
31
31
32
32
- name : Upload with path (directory)
33
33
uses : ./
34
34
with :
35
35
connection-string : ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
36
- name : ' azblob-upload-artifact '
36
+ name : ' azblob-upload-artifact3 '
37
37
path : ' path/to/artifact2'
38
+
39
+ - name : Upload (overwrite)
40
+ uses : ./
41
+ with :
42
+ connection-string : ${{ secrets.AZURE_STORAGE_CONNECTION_STRING }}
43
+ name : ' azblob-upload-artifact3'
44
+ path : ' path/to/artifact1'
Original file line number Diff line number Diff line change @@ -6,10 +6,13 @@ AZ_PATH=$1; shift
6
6
# Create a specified container
7
7
az storage container create -n " $AZ_CONTAINER "
8
8
9
+ # Remove resources in the directory
10
+ az storage blob delete-batch -s " $AZ_CONTAINER " --pattern " $AZ_NAME /*"
11
+
9
12
if [[ -d " $AZ_PATH " ]]; then
10
13
# Directory upload
11
- az storage blob upload-batch -d " $AZ_CONTAINER " -s " $AZ_PATH " --destination-path " $AZ_NAME / $AZ_PATH "
14
+ az storage blob upload-batch -d " $AZ_CONTAINER " -s " $AZ_PATH " --destination-path " $AZ_NAME "
12
15
else
13
16
# File upload
14
- az storage blob upload -c " $AZ_CONTAINER " -n " $AZ_NAME /$AZ_PATH " -f " $AZ_PATH "
17
+ az storage blob upload -c " $AZ_CONTAINER " -n " $AZ_NAME /$( basename $ AZ_PATH) " -f " $AZ_PATH "
15
18
fi
You can’t perform that action at this time.
0 commit comments