Skip to content

Commit

Permalink
ci: switch to window runner with installing rsync
Browse files Browse the repository at this point in the history
  • Loading branch information
Got17 committed Jan 14, 2025
1 parent 8525d1a commit da72150
Showing 1 changed file with 22 additions and 45 deletions.
67 changes: 22 additions & 45 deletions .github/workflows/ghpages.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,47 @@
name: Build and Deploy
name: Build and Deploy to GitHub Pages

on:
workflow_dispatch:
push:
branches:
- main
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: false
submodules: true

- name: Clear NuGet Cache
run: dotnet nuget locals all --clear

- name: Cache NuGet Packages
uses: actions/cache@v2
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Setup .NET
- name: Setup .NET 8
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.x'

- name: Add GitHub registry NuGet source
shell: cmd
run: |
dotnet nuget add source https://nuget.pkg.github.com/dotnet-websharper/index.json \
--name github \
--username intellifactory-gh \
--password "${{ secrets.PAT_PACKAGE }}" \
--store-password-in-clear-text
- name: Install Vite
run: npm install -g vite
dotnet nuget add source https://nuget.pkg.github.com/dotnet-websharper/index.json ^
--name github ^
--username intellifactory-gh ^
--password "${{ secrets.PAT_PACKAGE }}" ^
--store-password-in-clear-text
- name: Restore Binding Project Dependencies
run: dotnet restore --verbosity minimal
working-directory: WebSharper.CredentialManagement
- name: Build WebSharper Project
run: dotnet build WebSharper.CredentialManagement.Sample/WebSharper.CredentialManagement.Sample.fsproj --configuration Release

- name: Build Binding Project with Limited Parallelism
run: dotnet build --configuration Release --verbosity diagnostic --no-restore -maxcpucount:1
working-directory: WebSharper.CredentialManagement
- name: Install rsync
run: choco install rsync -y

- name: Restore Sample Project Dependencies
run: dotnet restore --verbosity minimal
working-directory: WebSharper.CredentialManagement.Sample

- name: Build Sample Project with Limited Parallelism
run: dotnet build --configuration Release --verbosity diagnostic --no-restore -maxcpucount:1
working-directory: WebSharper.CredentialManagement.Sample

- name: Build Static Files with Vite
run: npx vite build --outDir ../dist --base ./
working-directory: WebSharper.CredentialManagement.Sample/wwwroot/
- name: Prepare Deployment
run: |
mkdir -p dist
cp -r WebSharper.CredentialManagement.Sample/wwwroot/* dist/
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@releases/v3
uses: JamesIves/github-pages-deploy-action@v4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: dist
FOLDER: dist

0 comments on commit da72150

Please sign in to comment.