Skip to content

Commit f0e888f

Browse files
committed
ci: add GitHub Pages deployment workflow
1 parent f600f28 commit f0e888f

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches: [main]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: pages
15+
cancel-in-progress: false
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Install, build, and upload
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: 20
27+
cache: npm
28+
- run: npm ci
29+
- run: npm run build
30+
- name: Upload artifact
31+
uses: actions/upload-pages-artifact@v3
32+
with:
33+
path: dist
34+
35+
deploy:
36+
environment:
37+
name: github-pages
38+
url: ${{ steps.deployment.outputs.page_url }}
39+
runs-on: ubuntu-latest
40+
needs: build
41+
steps:
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v4

astro.config.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import tailwindcss from '@tailwindcss/vite';
44

55
// https://astro.build/config
66
export default defineConfig({
7+
site: 'https://Albert-Lsk.github.io/Markdown-Tutorial',
78
vite: {
89
plugins: [tailwindcss()]
910
},
@@ -13,5 +14,8 @@ export default defineConfig({
1314
routing: {
1415
prefixDefaultLocale: false
1516
}
17+
},
18+
build: {
19+
assets: '_assets'
1620
}
1721
});

0 commit comments

Comments
 (0)