Skip to content

Deploy to GitHub Pages #6

Deploy to GitHub Pages

Deploy to GitHub Pages #6

Workflow file for this run

name: Deploy to GitHub Pages
on:
push:
branches:
- main # 设置为您项目的主分支
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20' # 设置为您项目所需的 Node.js 版本
- name: Install dependencies
run: npm install
- name: Build project
run: npm run build
- name: Create CNAME file
run: echo 'www.qlnu-sec.cn' > ./dist/CNAME # 将 'your-custom-domain.com' 替换为您的自定义域名
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist # 设置为您的 Astro 项目构建输出目录