forked from jldeen/Ghost-Azure
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
671 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
|
||
on: | ||
# Trigger the workflow on push or pull request, | ||
# but only for the master branch | ||
push: | ||
branches: | ||
- 64bit | ||
|
||
name: ghosttest | ||
|
||
|
||
env: | ||
resourceGroup: "ghostest27jd2" | ||
location: centralus | ||
subName: "ca-jessde-demo-test" | ||
storageName: "ghostest27jd" | ||
webappName: "ghostest27jd" | ||
storageSku: Standard_LRS | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
steps: | ||
# checkout branch | ||
- name: git checkout master branch | ||
uses: actions/checkout@master | ||
|
||
# log into Azure | ||
- name: "Login via Azure CLI" | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
- name: Set up Node.js version | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '10.15.2' | ||
|
||
- run: npm install | ||
|
||
- run: npm run build --if-present | ||
env: | ||
CI: true | ||
|
||
- name: Clean up | ||
run: | | ||
'Remove-Item .\node_modules -Recurse' | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
# log into Azure | ||
- name: "Login via Azure CLI" | ||
uses: azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
|
||
# checkout branch | ||
- name: git checkout master branch | ||
uses: actions/checkout@master | ||
|
||
# create resource group | ||
- name: "Create Resource Group" | ||
run: | | ||
az group create --subscription "$subName" --name $resourceGroup --location $location | ||
- name: "Create App Service Plan" | ||
run : | | ||
az appservice plan create -g $resourceGroup -n $webappName --sku S1 | ||
- name: 'create storage' | ||
run: | | ||
az storage account create -n $storageName -g $resourceGroup -l $location --sku $storageSku | ||
- name: 'webapp create' | ||
run: | | ||
az webapp create --resource-group $resourceGroup --plan $webappName --name $webappName | ||
az webapp log config -n $webappName -g $resourceGroup --web-server-logging filesystem | ||
- name: 'web app config' | ||
run: | | ||
az webapp config set -g $resourceGroup -n $webappName \ | ||
--always-on true \ | ||
--use-32bit-worker-process false \ | ||
--web-sockets-enabled true \ | ||
--remote-debugging-enabled true | ||
- name: 'app settings' | ||
run: | | ||
connString=$(az storage account show-connection-string --resource-group $resourceGroup --name $storageName -o tsv) | ||
az webapp config appsettings set --resource-group $resourceGroup --name $webappName --settings \ | ||
url=https://$webappName.azurewebsites.net \ | ||
WEBSITE_NODE_DEFAULT_VERSION="D:\Program Files\nodejs\10.15.2\node" \ | ||
languageWorkers:node:defaultExecutablePath="D:\Program Files\nodejs\10.15.2\node" \ | ||
WEBSITE_NPM_DEFAULT_VERSION="6.4.1" \ | ||
NODE_ENV="production" \ | ||
npm_config_arch="x64" \ | ||
AZURE_STORAGE_CONNECTION_STRING=$connString | ||
- name: 'Run Azure webapp deploy action using publish profile credentials' | ||
uses: azure/webapps-deploy@v2 | ||
with: | ||
app-name: 'ghostest27jd' | ||
slot-name: 'production' | ||
publish-profile: ${{ secrets.AzureAppService_PublishProfile_27a2430c6eac4fd5b68e3b43483608dc }} | ||
package: . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License | ||
|
||
Copyright (c) 2019 Jessica Deen <[email protected]> | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
Oops, something went wrong.