Skip to content

Commit

Permalink
Create deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jkjoy committed Oct 28, 2024
1 parent e575a5e commit e1c9eb7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Deploy Astro Site

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'

- name: Install dependencies
run: npm install -g pnpm

- name: Install sharp
run: pnpm install && pnpm add sharp

- name: Build site
run: pnpm build

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.ASTRO }}
PUBLISH_BRANCH: gh-pages # 推送到当前 gh-pages 分支
publish_dir: ./dist
commit_message: ${{ github.event.head_commit.message }}

0 comments on commit e1c9eb7

Please sign in to comment.