From 55dc8a3f6d3bf7b6b95fbf310790ef7b6170ee55 Mon Sep 17 00:00:00 2001 From: Cyan Date: Thu, 14 Nov 2024 02:10:30 +0800 Subject: [PATCH] ci: update deploy.yml --- .github/workflows/deploy.yml | 38 ++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bf051e4..3a5b140 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,17 +18,35 @@ jobs: - uses: oven-sh/setup-bun@v2 with: bun-version: latest - - name: Cache Black Hole + - name: Restore Blackhole uses: actions/cache/restore@v4 with: - path: node_modules + path: | + node_modules key: blackhole + - name: Restore cache + uses: actions/cache@v4 + with: + path: | + dist + .nuxt + key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }} + restore-keys: | + ${{ runner.os }}-nuxt-build- # Pick your own package manager and build script - run: bun install --locked - - name: Save Black Hole + - name: Save Cache uses: actions/cache/save@v4 with: - path: node_modules + path: | + .nuxt + dist + key: ${{ runner.os }}-nuxt-build-${{ hashFiles('dist') }} + - name: Save Blackhole + uses: actions/cache/sa@v4 + with: + path: | + node_modules key: blackhole - run: bun run build --preset github_pages - name: Upload artifact @@ -59,6 +77,18 @@ jobs: with: name: build-output path: dist + - name: Setup Pages + uses: actions/configure-pages@v5 + with: + # Automatically inject router.base in your Nuxt configuration file and set + # target to static (https://nuxtjs.org/docs/configuration-glossary/configuration-target/). + # + # You may remove this line if you want to manage the configuration yourself. + static_site_generator: nuxt + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./dist - uses: actions/deploy-pages@v4 - name: Deploy to GitHub Pages id: deployment