Skip to content

Commit 992ba98

Browse files
committed
feat: deploy example to GitHub Pages
1 parent 2d4ffa7 commit 992ba98

File tree

5 files changed

+52
-3
lines changed

5 files changed

+52
-3
lines changed

.github/workflows/deploy.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
# Trigger the workflow every time you push to the `main` branch
5+
# Using a different branch name? Replace `main` with your branch’s name
6+
push:
7+
branches: [main, feat/example-site]
8+
# Allows you to run this workflow manually from the Actions tab on GitHub.
9+
workflow_dispatch:
10+
11+
# Allow this job to clone the repo and create a page deployment
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout your repository using git
22+
uses: actions/checkout@v4
23+
- name: Install, build, and upload your site output
24+
uses: withastro/action@v2
25+
with:
26+
path: examples/example-site # The root location of your Astro project inside the repository. (optional)
27+
node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 18. (optional)
28+
package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
29+
30+
deploy:
31+
needs: build
32+
runs-on: ubuntu-latest
33+
environment:
34+
name: github-pages
35+
url: ${{ steps.deployment.outputs.page_url }}
36+
steps:
37+
- name: Deploy to GitHub Pages
38+
id: deployment
39+
uses: actions/deploy-pages@v4

examples/example-site/astro.config.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,7 @@
22
import {defineConfig} from "astro/config";
33

44
// https://astro.build/config
5-
export default defineConfig({});
5+
export default defineConfig({
6+
site: "https://binzcodes.github.io",
7+
base: "visor",
8+
});

examples/example-site/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
"dependencies": {
1313
"astro": "^4.16.7",
1414
"@astrojs/check": "^0.9.4",
15+
"sharp": "^0.33.5",
16+
"sharp-ico": "^0.1.5",
1517
"typescript": "^5.6.3",
1618
"@binz/visor": "workspace:*"
1719
}

examples/example-site/src/pages/manifest.json.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
import path from "node:path";
21
import type {APIRoute} from "astro";
32
import Manifest from "@binz/visor/src/lib/manifest";
43

5-
import favicon from "../images/favicon.ico";
4+
import favicon from "./../images/Logo.svg";
65

76
const faviconPngSizes = [192, 512];
87

pnpm-lock.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)