From ea02af2b4db5a9b493913f9fb9cbd7936e47b6dd Mon Sep 17 00:00:00 2001 From: Martin Bryant Date: Thu, 7 Mar 2024 13:10:10 +0000 Subject: [PATCH] alter way demo is deployed in pages --- .github/workflows/deployment.yml | 31 +++++++++++++++++-------------- demo/package.json | 4 +--- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 291ccd3..d7463a7 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -6,45 +6,48 @@ on: jobs: build: - runs-on: ubuntu-latest + permissions: + contents: write steps: - name: Check out uses: actions/checkout@v4 - + - name: Setup .NET uses: actions/setup-dotnet@v4 with: dotnet-version: 8.0.x - + - name: Restore tools run: dotnet tool restore - -# Build and Pack need to be seperate operations due to error NU5026 + +# Build and Pack need to be separate operations due to error NU5026 - name: Build run: dotnet build --configuration Release - + - name: Pack run: dotnet pack --no-build -p:PackageVersion=${{ github.ref_name }} -p:PackageReleaseNotes=${{ github.event.release.html_url }} --output . working-directory: ./src/Feliz.ReactSpeedometer - + - name: Publish run: dotnet nuget push "*.nupkg" --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json working-directory: ./src/Feliz.ReactSpeedometer - + - name: Setup node uses: actions/setup-node@v4 with: node-version: 20 - + - name: Restore demo tools run: dotnet tool restore working-directory: ./demo - - name: Set git user - uses: fregante/setup-git-user@v2 - - - name: Deploy Demo - run: npm run publish-docs + - name: Build Demo + run: npm run build working-directory: ./demo + + - name: Deploy pages 🚀 + uses: JamesIves/github-pages-deploy-action@v4 + with: + folder: dist diff --git a/demo/package.json b/demo/package.json index bab495f..c5145f1 100644 --- a/demo/package.json +++ b/demo/package.json @@ -8,13 +8,11 @@ "prestart": "dotnet fable clean --yes && npm install", "start": "dotnet fable watch -s -o ./output --run npx vite", "prebuild": "dotnet fable clean --yes && npm install", - "build": "dotnet fable -s -o ./output --run npx vite build", - "publish-docs": "npm run build && node publish.js" + "build": "dotnet fable -s -o ./output --run npx vite build" }, "dependencies": { "bulma": "^0.9.1", "date-fns": "^2.16.1", - "gh-pages": "^3.1.0", "react-d3-speedometer": "^2.2.1", "react": "^18.2.0", "react-dom": "^18.2.0"