-
Notifications
You must be signed in to change notification settings - Fork 1
61 lines (57 loc) · 1.69 KB
/
deploy_static.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
name: Deploy Static
on:
# Run this workflow from other workflows
workflow_call:
inputs:
source:
description: 'Source package'
required: true
type: string
target:
description: 'Path to target folder'
required: true
type: string
max_age:
description: 'max-age for non-index.html files'
default: 604800
required: false
type: string
secrets:
creds:
required: true
jobs:
deploy_static:
runs-on: ubuntu-latest
steps:
- name: Download source
uses: actions/download-artifact@v4
with:
name: ${{ inputs.source }}
- uses: azure/login@v2
with:
creds: ${{ secrets.creds }}
- name: Upload to blob storage
id: upload
uses: azure/CLI@v2
with:
azcliversion: 2.33.1
inlineScript: |
az storage blob upload \
--account-name zooniversestatic \
--content-cache-control 'public, max-age=60' \
--container-name '$web' \
--name '${{ inputs.target }}/index.html' \
--file './index.html'
rm ./index.html
az storage blob upload \
--account-name zooniversestatic \
--content-cache-control 'public, max-age=60' \
--container-name '$web' \
--name '${{ inputs.target }}/commit_id.txt' \
--file './commit_id.txt'
rm ./commit_id.txt
az storage blob upload-batch \
--account-name zooniversestatic \
--content-cache-control 'public, immutable, max-age=${{ inputs.max_age }}' \
--destination '$web/${{ inputs.target }}' \
--source ./