Skip to content

Commit

Permalink
Updated build - self hosting fonts and mermaid - fixed some css and js (
Browse files Browse the repository at this point in the history
#3)

* changes

* Updated build - self hosting fonts and mermaid

* Added NotoSans and some bugfixes -moved to jekyll-src

* Added some workflows

* Linting changes (#2)

Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
lsegurado and github-actions[bot] authored Nov 7, 2024
1 parent 2cd31a4 commit 4eefd3a
Show file tree
Hide file tree
Showing 48 changed files with 247 additions and 83 deletions.
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@ updates:
directory: '/'
schedule:
interval: 'daily'
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
31 changes: 19 additions & 12 deletions .github/workflows/jekyll.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,23 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
fetch-depth: 0

- name: Git configuration
uses: michijs/.github/.github/actions/set-git-config-github-actions@main
- name: Set up environment
uses: michijs/.github/.github/actions/setup@main

- name: Set up Node.js
uses: actions/setup-node@v4
- name: Install dependencies
uses: michijs/.github/.github/actions/install@main
with:
node-version: latest
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Git configuration
uses: michijs/.github/.github/actions/set-git-config-github-actions@main

- name: Fetch npm Versions
id: fetch_versions
run: |
VERSIONS=$(npm show @michijs/michijs versions --json)
VERSIONS=$(bunx npm show @michijs/michijs versions --json)
FILTERED_VERSIONS=$(echo "$VERSIONS" | jq -r 'map(select(. | test("beta|rc") | not)) | join(" ")')
echo "VERSIONS=$FILTERED_VERSIONS" >> $GITHUB_ENV
Expand All @@ -47,14 +50,14 @@ jobs:
run: |
for version in $VERSIONS; do
if [[ $version == $(echo "$VERSIONS" | awk '{print $NF}') ]]; then
wget -O README.md https://raw.githubusercontent.com/michijs/michijs/v$version/README.md
wget -O jekyll-src/README.md https://raw.githubusercontent.com/michijs/michijs/v$version/README.md
else
if [ ! -f "v$version.md" ]; then
wget -O v$version.md https://raw.githubusercontent.com/michijs/michijs/v$version/README.md
wget -O jekyll-src/v$version.md https://raw.githubusercontent.com/michijs/michijs/v$version/README.md
fi
fi
done
wget -O Next.md https://raw.githubusercontent.com/michijs/michijs/master/README.md
wget -O jekyll-src/Next.md https://raw.githubusercontent.com/michijs/michijs/master/README.md
- name: Commit changes
uses: michijs/.github/.github/actions/commit-if-changes@main
Expand All @@ -66,14 +69,18 @@ jobs:
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Build
uses: michijs/.github/.github/actions/run@main
with:
command: build

- name: Setup Pages
uses: actions/configure-pages@v5

- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
source: ./jekyll-src

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Lint"

on: [push, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
call-workflow:
uses: michijs/.github/.github/workflows/lint.yml@main
name: "Run lint"
secrets: inherit
17 changes: 17 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: "Tests"

on: [push, workflow_dispatch]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
call-workflow:
strategy:
matrix:
scripts: [{script: test-tsc, name: "Typescript"}]
uses: michijs/.github/.github/workflows/execute-script.yml@main
name: "Run ${{matrix.scripts.name}} tests"
with:
script-name: ${{ matrix.scripts.script }}
37 changes: 36 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,38 @@
Gemfile.lock
_site
.jekyll-cache
.jekyll-cache
.bundle

dist/
!www/favicon.ico
www/
build/
bun.lockb
jekyll-src/assets/js

*~
*.sw[mnpcod]
*.log
*.lock
*.tmp
*.tmp.*
log.txt
*.sublime-project
*.sublime-workspace

.idea/
.sass-cache/
.versions/
.cache/
node_modules/
$RECYCLE.BIN/

.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
.env

package-lock.json
.eslintcache

rome.json
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"explorer.fileNesting.enabled": true,
"explorer.fileNesting.expand": false,
"explorer.fileNesting.patterns": {
"README.md": "*.md",
"Gemfile": "Gemfile.lock, _config.yml",
"package.json": "bun.lockb, .gitignore, tsconfig.json, rome.json, dist.tsconfig.json, LICENSE.md, package-lock.json, jest-puppeteer.config.js, michi.config.ts",
"*.tsx": "$(capture).css, $(capture).css.ts, $(capture).html, $(capture).spec.ts, $(capture).spec.tsx, $(capture).stories.tsx, types.ts, constants.ts",
}
}
25 changes: 18 additions & 7 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
source "https://rubygems.org"

# 1. bundle install
# 2. bundle exec jekyll serve
gem "jekyll", "~> 3.9.5"
# 1. gem install bundler
# 2. bundle install
# 3. bundle exec jekyll serve --livereload
# gem "jekyll", "~> 3.10.0"

group :jekyll_plugins do
# https://github.com/github/pages-gem
gem "github-pages", "~> 231"
gem "github-pages", "~> 232"
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby]
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.0" if Gem.win_platform?
# gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]

gem "webrick", "~> 1.9"
3 changes: 2 additions & 1 deletion _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ defaults:
path: "" # an empty string here means all files in the project
values:
layout: "default"
render_with_liquid: false # Avoids using liquid inside pages - only works on jekyll > 4
render_with_liquid: false # Avoids using liquid inside pages - only works on jekyll > 4
source: "jekyll-src"
25 changes: 0 additions & 25 deletions assets/js/main.js

This file was deleted.

13 changes: 0 additions & 13 deletions assets/js/mermaid.js

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 1 addition & 7 deletions _layouts/default.html → jekyll-src/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@
<link rel="alternate icon" type="image/x-icon"
href="https://raw.githubusercontent.com/michijs/art/main/logo-with-background-square.png">
<link rel="stylesheet" href="/assets/css/style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link
href="https://fonts.googleapis.com/css2?family=Fira+Code:[email protected]&family=Noto+Sans:ital,wght@0,100..900;1,100..900&display=swap"
rel="stylesheet">
<title>MichiJS</title>
</head>

Expand Down Expand Up @@ -48,7 +43,6 @@
</main>
</body>

<script src="/assets/js/main.js" type="module"></script>
<script src="/assets/js/mermaid.js" type="module"></script>
<script src="/assets/js/index.js" type="module"></script>

</html>
Binary file added jekyll-src/assets/css/FiraCode-VF.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 4eefd3a

Please sign in to comment.