Skip to content

deploy-wasm-prd

deploy-wasm-prd #240

Workflow file for this run

name: deploy-wasm-prd
on:
release:
types: [ published ]
workflow_dispatch:
jobs:
deploy-prd:
runs-on: ubuntu-latest
steps:
- name: git pull
uses: actions/checkout@v3
with:
submodules: 'recursive'
- run: git submodule foreach git checkout main
- name: Find and replace
uses: jacobtomlinson/gha-find-replace@v3
with:
find: '\?version='
replace: '?version=${{ github.event.release.tag_name }}'
include: 'docs/Masa.Docs.WebAssembly/wwwroot/index.html'
- name: setting dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.x
7.0.x
8.0.402
include-prerelease: true
- name: setting tools
run: dotnet workload install wasm-tools
- name: build
run: dotnet build Masa.Blazor.Docs.sln
- name: publish
run: dotnet publish docs/Masa.Docs.WebAssembly/Masa.Docs.WebAssembly.csproj -c Release -f net8.0
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: execute py script
env:
DOC_DOMAIN: "https://docs.masastack.com"
run: python scirpts/sitemapgenerate.py
- name: setup oss
uses: manyuanrong/[email protected]
with:
endpoint: "oss-cn-hangzhou.aliyuncs.com"
access-key-id: ${{ secrets.ACCESS_KEY_ID }}
access-key-secret: ${{ secrets.ACCESS_KEY_SECRET }}
- name: deploy oss
run: ossutil cp -rf /home/runner/work/MASA.Blazor/MASA.Blazor/docs/Masa.Docs.WebAssembly/bin/Release/net8.0/publish/wwwroot/ oss://masa-blazor-wasm-v1/
- name: run index-create tools
env:
MASA_DOC_DOMAIN: "/"
MASA_ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
MASA_ALGOLIA_APP_ID: "TSB4MACWRC"
MASA_ALGOLIA_INDEX_PREFIX: "blazor-masastack_prd_"
MASA_ROOT_DOCS_PATH: "/home/runner/work/MASA.Blazor/MASA.Blazor/docs/"
# MASA_DOC_EXCLUDE_URLS if many please seperate with || , e.g. "/blazor/about/about||/blazor/about/meet-the-team"
MASA_DOC_EXCLUDE_URLS: "/blazor/about/about||/blazor/about/meet-the-team"
run: cd docs/Masa.Docs.Indexing && dotnet run --project Masa.Docs.Indexing.csproj --no-launch-profile -c Release