-
-
Notifications
You must be signed in to change notification settings - Fork 140
91 lines (81 loc) · 3.25 KB
/
Copy pathdeploy.yaml
File metadata and controls
91 lines (81 loc) · 3.25 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
name: Build & Deploy GitHub Pages (dual builds, parallel)
on:
workflow_dispatch:
push:
branches: [ main, master ]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
deploy:
# 8 vCPU: docusaurus `faster` mode spreads SSG over worker threads, and this site
# generates ~4k pages across the versioned docs
runs-on: blacksmith-8vcpu-ubuntu-2404
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
target:
- mode: docs
repo: gofiber/docs
cname: docs.gofiber.io
- mode: home
repo: gofiber/website
cname: gofiber.io
steps:
- name: Get previous workflow status
uses: Mercymeilya/last-workflow-status@f86bce177498d6fdd3bda4113d7d93266cfc3fca # v0.3.5
id: last_status
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# npm ci runs third-party install scripts in this workspace; don't leave
# the token in .git/config for them. gh-pages pushes with its own PAT.
persist-credentials: false
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v6
with:
node-version: 24
cache: npm
cache-dependency-path: |
package-lock.json
**/package-lock.json
- name: Restore build caches
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
node_modules/.cache
.docusaurus
key: docusaurus-${{ runner.os }}-node24-${{ hashFiles('package-lock.json') }}
restore-keys: |
docusaurus-${{ runner.os }}-node24-
- name: Install deps
run: npm ci
- name: Build (${{ matrix.target.mode }})
env:
NODE_ENV: production
BUILD_TARGET: ${{ matrix.target.mode }}
INKEEP_API_KEY: ${{ secrets.INKEEP_API_KEY }}
INKEEP_INTEGRATION_ID: ${{ secrets.INKEEP_INTEGRATION_ID }}
INKEEP_ORGANIZATION_ID: ${{ secrets.INKEEP_ORGANIZATION_ID }}
run: |
npm run build:${{ matrix.target.mode }}
- name: Deploy to ${{ matrix.target.cname }} (on master)
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && (github.ref_name == 'main' || github.ref_name == 'master')
uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0
with:
personal_token: ${{ secrets.GH_PAGES_TOKEN }} # PAT with Contents: Read and write on both repos
external_repository: ${{ matrix.target.repo }}
publish_dir: ./build
publish_branch: gh-pages
cname: ${{ matrix.target.cname }}
force_orphan: true
- uses: sarisia/actions-status-discord@eb045afee445dc055c18d3d90bd0f244fd062708 # v1
if: ${{ failure() || (success() && steps.last_status.outputs.last_status == 'failure') }}
with:
title: "deploy"
description: "Docs: Build & Deploy GitHub Pages"
webhook: ${{ secrets.DISCORD_SECURE_CHANNEL }}