Skip to content

Commit

Permalink
feat: Add site manifest
Browse files Browse the repository at this point in the history
Signed-off-by: ittuann <ittuann@outlook.com>
  • Loading branch information
ittuann committed Aug 18, 2024
1 parent a2e36a3 commit 190f1ee
Show file tree
Hide file tree
Showing 12 changed files with 2,960 additions and 1,433 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
workflow_dispatch:

jobs:
build:
build-website:
runs-on: ubuntu-latest

steps:
Expand Down
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Deploy to gh-pages

on:
workflow_run:
workflows:
- CI
types:
- completed
workflow_dispatch:

jobs:
gh-deploy:
runs-on: ubuntu-latest

if: github.ref == 'refs/heads/main' && github.event.workflow_run.event == 'push' && github.event.workflow_run.conclusion == 'success'

permissions:
contents: write

steps:
- name: Checking Out
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Prepare github pages
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
LATEST_HASH=$(git rev-parse --short=7 HEAD)
git clone https://github.com/ittuann/Awesome-IntelligentCarRace.git pages
cd pages
git checkout gh-pages
if [[ "$(git ls-files)" ]]; then git rm -rf .; fi
git clean -fxd
cp ../index.html .
cp ../dist ./dist
cp ../iconx ./iconx
git add .
git commit -s -m "Deployed GitHub Pages - $LATEST_HASH"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
directory: pages
Binary file added iconx/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iconx/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iconx/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iconx/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iconx/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added iconx/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions iconx/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"}
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
<meta charset="UTF-8">
<title>Route to CIDR Converter</title>
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css" rel="stylesheet">
<link rel="apple-touch-icon" sizes="180x180" href="iconx/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="iconx/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="iconx/favicon-16x16.png">
<link rel="manifest" href="iconx/site.webmanifest">
</head>

<body class="bg-gray-100 flex justify-center items-center min-h-screen">
Expand All @@ -28,8 +32,7 @@ <h2 class="text-lg font-semibold text-gray-700">工具介绍</h2>
</p>
<p class="text-gray-600 mt-2">
工具为开源项目,完整代码已上传至
<a href="https://github.com/ittuann/Route2CIDR"
class="text-blue-500 hover:text-blue-700"
<a href="https://github.com/ittuann/Route2CIDR" class="text-blue-500 hover:text-blue-700"
target="_blank">GitHub</a>。所有转换操作均仅在本地浏览器内进行,网页不会对您的输入进行存储,无需担心数据安全。
</p>
</div>
Expand Down
Loading

0 comments on commit 190f1ee

Please sign in to comment.