-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (39 loc) · 1.55 KB
/
node.js.yml
File metadata and controls
43 lines (39 loc) · 1.55 KB
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
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
push:
branches: [master]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get NodeJS Version from package.json
run: |
echo "$(cat ./package.json)" | jq .engines.node | xargs -I {} echo "NodeVersion="{} >> $GITHUB_ENV
- name: Use Node.js ${{ env.NodeVersion }}
uses: actions/setup-node@v1
with:
node-version: ${{ env.NodeVersion }}
- run: npm ci
- run: npx hexo generate
- name: Azure Blob Storage Upload
# You may pin to the exact commit or the version.
# uses: bacongobbler/azure-blob-storage-upload@779a18b594a1a7cf5412645e06c856324a8b01e5
uses: bacongobbler/azure-blob-storage-upload@v1.2.0
with:
connection_string: ${{ secrets.BLOB_CONNECTION_STRING }}
container_name: $web
source_dir: public
- name: Azure Login
uses: Azure/login@v1
with:
creds: ${{secrets.AZURE_CREDENTIALS}}
- name: Azure CLI Action
uses: Azure/cli@v1
with:
inlineScript: |
az account show
az login && az cdn endpoint purge -n aspnetmonsters -g aspnetmonsters --profile-name aspnetmonsters --no-wait --content-paths '/' '/index.html'