For smaller screen #22
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
name: Deploy static content to Pages | |
on: | |
push: | |
branches: ['master'] | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: 'pages' | |
cancel-in-progress: false | |
jobs: | |
deploy: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Pages | |
uses: actions/setup-node@v3 | |
- name: Setup MSBuild | |
uses: microsoft/setup-msbuild@v1 | |
- name: Build | |
run: | | |
powershell | |
cd web | |
yarn | |
yarn build:zip | |
echo '<html><head><script>if(!localStorage.getItem("musiche-proxy-address"))localStorage.setItem("musiche-proxy-address","https://music.picapico.top/proxy");localStorage.setItem("musiche-router-prefix","musiche");let pathname=location.pathname.substring(9);let redirect=pathname?`${(location.search?"&":"?")}redirect=${pathname}`:"";location.href="/musiche"+location.search+redirect;</script></head></html>' > dist/404.html | |
cd ..\windows | |
echo "<Weavers><Costura/></Weavers>" > FodyWeavers.xml | |
mv ..\web\web.zip Resources\web.zip | |
msbuild Musiche.sln -t:"Restore;Build" /p:Configuration=Release /p:Platform="Any CPU" | |
msbuild Musiche.sln -t:"Restore;Build;Publish" /p:Configuration=Release /p:Platform="Any CPU" /p:PublishProfile="Properties\PublishProfiles\net6.0.pubxml" /p:TargetFramework=net6.0-windows | |
cd .. | |
copy windows\bin\Release\net472\Musiche.exe web\dist\Musiche.exe | |
copy windows\bin\Publish\net6.0-windows\Musiche.exe web\dist\Musiche.net6.exe | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
# Upload entire repository | |
path: 'web/dist' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
web\dist\Musiche.exe | |
web\dist\Musiche.net6.exe | |
windows\Resources\web.zip |