-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeploy.js
More file actions
32 lines (30 loc) · 771 Bytes
/
deploy.js
File metadata and controls
32 lines (30 loc) · 771 Bytes
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
import ghpages from 'gh-pages';
const ghToken = process.env.GITHUB_TOKEN,
gitUser = ghToken
? {
name: 'github-actions-bot',
email: 'support+actions@github.com',
}
: {
name: 'Matteo Bruni',
email: '176620+matteobruni@users.noreply.github.com',
};
ghpages.publish(
'./public',
{
repo: ghToken
? `https://git:${ghToken}@github.com/tsparticles/confetti.git`
: `https://git:github.com/tsparticles/confetti.git`,
dotfiles: true,
history: false,
message: 'build: gh pages updated',
user: gitUser,
},
(publishErr) => {
if (!publishErr) {
console.log('Website published successfully');
} else {
console.log(`Error publishing website: ${publishErr}`);
}
}
);