Skip to content

Commit c73ce6b

Browse files
authored
Create action.yml
1 parent 5c7f645 commit c73ce6b

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

action.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: 'Upload SPA to Azure Blob'
2+
description: 'Deploys a frontend to Azure Blob and activates the index.html file at last'
3+
inputs:
4+
connectionstring:
5+
required: true
6+
type: string
7+
container:
8+
required: true
9+
type: string
10+
source:
11+
required: true
12+
type: string
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Prepare upload without index.html
18+
shell: bash
19+
run: |
20+
mkdir upload
21+
rsync -av --exclude 'index.html' '${{ inputs.source }}' ./upload/
22+
23+
- name: Upload all without index.html to Azure Blob (pre-stage)
24+
uses: azure/cli@v2
25+
with:
26+
inlineScript: |
27+
az storage blob upload-batch \
28+
--connection-string '${{ inputs.connectionstring }}' \
29+
--overwrite \
30+
--destination '${{ inputs.container }}' \
31+
--source ./upload \
32+
33+
- name: Upload the index.html to Azure Blob (activation)
34+
uses: azure/cli@v2
35+
with:
36+
inlineScript: |
37+
az storage blob upload \
38+
--connection-string '${{ inputs.connectionstring }}' \
39+
--container-name '${{ inputs.container }}' \
40+
--file ${{ inputs.source }}/index.html \
41+
--name index.html \
42+
--overwrite \
43+
--content-type text/html \
44+
--content-cache-control "no-cache"

0 commit comments

Comments
 (0)