-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (83 loc) · 2.44 KB
/
cd.yml
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
name: cd
on:
push:
branches:
- main
paths:
- '.github/workflows/cd.yml'
- 'docs/**'
workflow_dispatch:
# inputs:
# logLevel:
# description: 'Log level'
# required: true
# default: 'warning'
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
deploy:
if: github.repository == 'da-michele/da-michele.com'
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.optional }}
timeout-minutes: 15 # default is 6 hours!
strategy:
max-parallel: 1
fail-fast: false
matrix:
include:
- os: ubuntu-latest
node-version: 'latest'
optional: false
name: Deploy (Vitepress, ${{ matrix.os }}, node ${{ matrix.node-version }})
steps:
- name: Git config
run: |
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
git config --global user.name 'github-actions[bot]'
git config --global init.defaultBranch main
# https://github.com/actions/checkout
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# https://github.com/pnpm/action-setup
- name: Install pnpm
uses: pnpm/action-setup@v4
# https://github.com/actions/setup-node
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Install deps
run: |
pnpm install
- name: Check deps
run: |
pnpm list --recursive
pnpm licenses list
pnpm outdated --recursive
- name: Check pnpm
run: |
pnpm doctor
- name: Build docs
run: |
pnpm run docs-build
# https://github.com/crazy-max/ghaction-github-pages
- name: Deploy docs
if: success()
uses: crazy-max/ghaction-github-pages@v4
with:
allow_empty_commit: false
build_dir: docs/.vitepress/dist
fqdn: da-michele.com
author: 'Ristorante Da Michele Baden-Baden <info@da-michele.com>'
committer: 'github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>'
# keep_history: false
# target_branch: gh-pages
jekyll: false
verbose: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}