Skip to content

Commit

Permalink
使用github action 直接部署pages
Browse files Browse the repository at this point in the history
  • Loading branch information
yunnysunny committed Jan 21, 2024
1 parent 416b730 commit 7765375
Showing 1 changed file with 34 additions and 5 deletions.
39 changes: 34 additions & 5 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,32 @@ on:
push:
branches:
- master # default branch
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
CI: github

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
pages:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Restore file update time
Expand All @@ -32,8 +51,18 @@ jobs:
run: rm -rf output
- name: Build
run: npm run build
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
# - name: Deploy
# uses: peaceiris/actions-gh-pages@v3
# with:
# github_token: ${{ secrets.GITHUB_TOKEN }}
# publish_dir: ./output
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./output
# Upload entire repository
path: './output'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit 7765375

Please sign in to comment.