-
Notifications
You must be signed in to change notification settings - Fork 7
57 lines (46 loc) · 1.88 KB
/
build-stage-push-azure.yml
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
name: CICD Frontend Stage
run-name: ${{ github.actor }} Committed code for azure blob storage
on:
push:
branches:
- stage
workflow_dispatch:
env:
ACCOUNT_NAME: udirdit
SOURCE: dist
DESTINATION: frontend-stage
AZURE_STORAGE_KEY: ${{ secrets.AZURE_STORAGE_KEY }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: yarn install
- name: Run build script
run: yarn stage
- name: Login to Azure
uses: azure/login@v2
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: Upload files to Azure Blob
uses: azure/CLI@v2
with:
azcliversion: 2.34.1
inlineScript: |
az storage blob upload-batch --account-name ${{ env.ACCOUNT_NAME }} \
--auth-mode key -s ${{ env.SOURCE }} -d ${{ env.DESTINATION }} --overwrite
az storage blob list --account-name ${{ env.ACCOUNT_NAME }} --container-name ${{ env.DESTINATION }} --query "[?ends_with(name, '.woff')].{Name:name}" --output tsv | \
xargs -I {} az storage blob update --account-name ${{ env.ACCOUNT_NAME }} --container-name ${{ env.DESTINATION }} --name {} --content-type "application/font-woff"
az storage blob list --account-name ${{ env.ACCOUNT_NAME }} --container-name ${{ env.DESTINATION }} --query "[?ends_with(name, '.woff2')].{Name:name}" --output tsv | \
xargs -I {} az storage blob update --account-name ${{ env.ACCOUNT_NAME }} --container-name ${{ env.DESTINATION }} --name {} --content-type "font/woff2"
# Azure logout - Force step to always run with 'always()', ensures no hanging logins
- name: logout
if: always()
run: |
az logout