-
Notifications
You must be signed in to change notification settings - Fork 2.4k
70 lines (65 loc) · 2.31 KB
/
Copy pathdeploy.yml
File metadata and controls
70 lines (65 loc) · 2.31 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
name: Deploy
on:
push:
branches: [main]
# Started by the Dependabot auto-merge workflow, since merges made with
# GITHUB_TOKEN don't trigger `push` workflows, and by the Publish workflow
# after a release reaches npm.
workflow_dispatch:
permissions:
contents: read
# Deploy one at a time, in order; never cancel a deploy in progress.
concurrency:
group: deploy
cancel-in-progress: false
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Use Node.js
uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
# Auto-caching runs the bundled npm (v11) before it is upgraded
# below, which fails the devEngines npm >=12 check.
package-manager-cache: false
- run: npm install -g npm@12
# Builds Pure into build/, which the docs site bundles.
- run: npm ci
- name: Build the docs site
working-directory: site
run: |
npm ci
# Link to the root package.json version once it's on npm, so a
# release updates the site without bumping site/package.json.
# Otherwise (a -pre version, or not yet published) keep the pinned
# version, which is always a published one.
version=$(node -p "require('../package.json').version")
if npm view "purecss@$version" version > /dev/null 2>&1; then
npm install --no-save "purecss@$version"
else
echo "::notice::purecss@$version is not on npm; using the pinned version."
fi
npm run pure
npm run build
- name: Check that every docs page renders
working-directory: site
run: |
npx playwright install --with-deps --only-shell chromium
npm test
- uses: webfactory/ssh-agent@v0.10.0
with:
ssh-private-key: ${{ secrets.GH_PAGES_DEPLOY }}
- name: Release to GitHub Pages
working-directory: site
env:
DEPLOYMENT_BRANCH: main
GH_EMAIL: ${{ secrets.GH_EMAIL }}
GH_NAME: ${{ secrets.GH_NAME }}
GIT_USER: ${{ secrets.GH_NAME }}
USE_SSH: true
run: |
git config --global user.name "${GH_NAME}"
git config --global user.email "${GH_EMAIL}"
npx docusaurus deploy --skip-build