Build and deploy to VisualAPI #118
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
# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy | |
# More GitHub Actions for Azure: https://github.com/Azure/actions | |
name: Build and deploy to VisualAPI | |
on: | |
workflow_run: | |
workflows: ["Build nuget dotnet programmer all"] | |
types: | |
- completed | |
# on: | |
# push: | |
# tags: | |
# - "vAPI*" | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
# strategy: | |
# matrix: | |
# node-version: [16.13.0] | |
steps: | |
- uses: actions/checkout@v2 | |
# - name: Node ${{ matrix.node-version }} | |
# uses: actions/setup-node@v1 | |
# with: | |
# node-version: ${{ matrix.node-version }} | |
- name: Download artifact main site | |
id: download-artifact-main | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
github_token: ${{secrets.GITHUB_TOKEN}} | |
workflow: deployVersion.yml | |
name: releaseBlocklyAutomation | |
workflow_conclusion: success | |
path: ${{github.workspace}}/src/react_new_app/my-app/build/ | |
if_no_artifact_found: fail | |
- name: Download artifact | |
id: download-artifact-docs-localAPI | |
uses: dawidd6/action-download-artifact@v2 | |
with: | |
github_token: ${{secrets.GITHUB_TOKEN}} | |
workflow: deployVersion.yml | |
name: localAPIDocs | |
workflow_conclusion: success | |
path: ${{github.workspace}}/src/react_new_app/my-app/build/help/ | |
if_no_artifact_found: fail | |
- name: verify exists | |
run: | | |
ls -l ${{github.workspace}}/src/react_new_app/my-app/build/ | |
- name: Set up .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: '7.x' | |
include-prerelease: false | |
# - name: npm install | |
# run: | | |
# cd src | |
# cd react_new_app | |
# cd my-app | |
# npm i -g npm@8.1.0 | |
# npm i | |
# - name: build site | |
# run: | | |
# cd src | |
# cd react_new_app | |
# cd my-app | |
# npm run build | |
- name: Build with dotnet | |
run: | | |
cd src | |
cd apps | |
cd TestDataNetCoreBlocklyAPI | |
cd TestDataNetCoreBlocklyAPI | |
cd wwwroot | |
rm -rf BlocklyAutomation | |
mkdir BlocklyAutomation | |
cp -R ${{github.workspace}}/src/react_new_app/my-app/build/* BlocklyAutomation | |
cd .. | |
cd .. | |
ls -l | |
dotnet build --configuration Release | |
- name: dotnet publish | |
run: | | |
cd src | |
cd apps | |
cd TestDataNetCoreBlocklyAPI | |
cd TestDataNetCoreBlocklyAPI | |
dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/myapp | |
- name: Upload artifact for deployment job | |
uses: actions/upload-artifact@v2 | |
with: | |
name: .net-app | |
path: ${{env.DOTNET_ROOT}}/myapp | |
deploy: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
needs: build | |
environment: | |
name: 'Production' | |
url: ${{ steps.deploy-to-webapp.outputs.webapp-url }} | |
steps: | |
- name: Download artifact from build job | |
uses: actions/download-artifact@v2 | |
with: | |
name: .net-app | |
- name: Deploy to Azure Web App | |
id: deploy-to-webapp | |
uses: azure/webapps-deploy@v2 | |
with: | |
app-name: 'VisualAPI' | |
slot-name: 'Production' | |
publish-profile: ${{ secrets.AZUREAPPSERVICE_PUBLISHPROFILE_29F69EA3E2E84928B72267B575A267E7 }} | |
package: . |