-
Notifications
You must be signed in to change notification settings - Fork 2
112 lines (93 loc) · 3.68 KB
/
Copy pathdeploy.yml
File metadata and controls
112 lines (93 loc) · 3.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Deploy Docs
on:
push:
branches: [master]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
# Only one concurrent deployment per target; cancel in-progress runs
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
# ── Build for GitHub Pages ────────────────────────────────────────────────
build-github-pages:
name: Build (GitHub Pages)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-gh-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-gh-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Enable Corepack (Yarn 4)
run: corepack enable
- name: Install dependencies
run: yarn install
- name: Configure Pages
id: pages
uses: actions/configure-pages@v5
- name: Build
run: yarn build
# env:
# Only set basePath when NOT using a custom domain on GitHub Pages.
# If you have a custom domain, remove this env var (leave it blank or delete).
# If deploying to https://<user>.github.io/<repo>, set to /<repo>.
# NEXT_BASE_PATH: ${{ steps.pages.outputs.base_path }}
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: out
# ── Deploy to GitHub Pages ────────────────────────────────────────────────
deploy-github-pages:
name: Deploy (GitHub Pages)
needs: build-github-pages
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deploy
uses: actions/deploy-pages@v5
# ── Build & Deploy to EdgeOne Pages ──────────────────────────────────────
deploy-edgeone:
name: Deploy (EdgeOne Pages)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
- name: Restore cache
uses: actions/cache@v4
with:
path: |
.next/cache
# Generate a new cache whenever packages or source files change.
key: ${{ runner.os }}-eo-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }}
# If source files changed but packages didn't, rebuild from a prior cache.
restore-keys: |
${{ runner.os }}-eo-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
- name: Enable Corepack (Yarn 4)
run: corepack enable
- name: Install dependencies
run: yarn install
- name: Build
run: yarn build
# No NEXT_BASE_PATH — EdgeOne Pages uses your custom domain (no sub-path)
- name: Deploy to EdgeOne Pages
run: npx edgeone pages deploy ./out -n reareye-docs -t ${{ secrets.EDGEONE_API_TOKEN }}