ant-design-blazor/.github/workflows/gh-pages.yml

97 lines
3.3 KiB
YAML
Raw Normal View History

2020-03-13 00:04:29 +08:00
name: Publish Docs
2019-12-04 21:43:44 +08:00
2019-12-12 22:51:33 +08:00
env:
2021-02-04 16:13:20 +08:00
Version: 0.7.0
NUGET_API_KEY: ${{secrets.NUGET_API_KEY}}
2019-12-12 22:51:33 +08:00
on:
push:
branches:
2020-05-29 09:40:48 +08:00
- master
2019-12-04 21:43:44 +08:00
jobs:
publish-and-deploy:
runs-on: ubuntu-latest
2020-05-29 09:40:48 +08:00
if: github.repository_owner == 'ant-design-blazor'
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Setup .NET Core 3.1
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.300
- name: Setup .NET Core 5.0
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.0.100
- uses: actions/setup-node@v1
with:
node-version: "10.x"
- name: Test And Coverage Report 📝
run: |
dotnet build
dotnet test --collect:"XPlat Code Coverage"
find ./tests -name "coverage.cobertura.xml" -type f -exec cp {} ./ \;
bash <(curl -s https://codecov.io/bash) -Z -f coverage.cobertura.xml -t $CODECOV_TOKEN
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- name: Package Nightly Nuget 📦
id: pack
run: |
FULL_VERSION=$Version-nightly-`date "+%y%m%d%H%M"`
echo "Version: ${FULL_VERSION}"
echo "::set-output name=package_version::${FULL_VERSION}"
dotnet pack components/AntDesign.csproj /p:PackageVersion=${FULL_VERSION} -c Release -o publish
- name: Publish to Nuget ✔
run: |
dotnet nuget push publish/*.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_API_KEY --skip-duplicate
- name: Publish Docs 🎉
run: |
npm install
echo "/* updated `date "+%Y-%m-%d %H:%M:%S"` */" >> ./site/AntDesign.Docs.Wasm/wwwroot/service-worker.published.js
cp -rf scripts/gh-pages/* scripts/gh-pages/.nojekyll scripts/gh-pages/.spa ./site/AntDesign.Docs.Wasm/wwwroot
sed -i s/{version}/$PACKAGE_VERSION/g ./site/AntDesign.Docs.Wasm/wwwroot/index.html
sed -i s/{version}/$PACKAGE_VERSION/g ./site/AntDesign.Docs/Shared/HeaderMenu.razor
dotnet publish ./site/AntDesign.Docs.Wasm -c Release -f net5 -o cargo
env:
PACKAGE_VERSION: ${{ steps.pack.outputs.package_version }}
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
ACCESS_TOKEN: ${{ secrets.GH_PUSH_TOKEN }}
BRANCH: gh-pages
FOLDER: cargo/wwwroot
2020-03-13 00:04:29 +08:00
- name: Deploy to Github.io 🚀
uses: peaceiris/actions-gh-pages@v3
with:
personal_token: ${{ secrets.GH_PUSH_TOKEN }}
external_repository: ant-design-blazor/ant-design-blazor.github.io
publish_branch: master
publish_dir: ./cargo/wwwroot
2020-11-28 15:36:48 +08:00
cname: antblazor.com
tag_name: ${{ steps.pack.outputs.package_version }}
- name: Sync to Gitee 💕
uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }}
with:
source-repo: "git@github.com:ant-design-blazor/ant-design-blazor.git"
destination-repo: "git@gitee.com:ant-design-blazor/ant-design-blazor.git"
# - name: 🧹Purge jsDeliver CDN
# run: |
# bash ./scripts/purge-jsdelivr.sh ./cargo/wwwroot ant-design-blazor/ant-design-blazor.github.io