forked from tsparticles/tsparticles
-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (84 loc) · 2.8 KB
/
deploy-websites.yml
File metadata and controls
98 lines (84 loc) · 2.8 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
name: Deploy Websites
on:
schedule:
- cron: '0 0 * * *'
push:
branches:
- main
paths:
- 'websites/confetti/**'
- 'websites/website/**'
- '.github/workflows/deploy-websites.yml'
workflow_dispatch:
concurrency:
group: deploy-websites-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
NX_CLOUD_ACCESS_TOKEN: "${{ secrets.NX_CLOUD_ACCESS_TOKEN }}"
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: pnpm/action-setup@v6
with:
cache: true
- uses: actions/setup-node@v6
with:
node-version: '24'
- name: Initialize Nx Cloud or fall back to local
run: |
if [ -z "$NX_CLOUD_ACCESS_TOKEN" ]; then
echo "NX Cloud token missing — using local nx execution"
echo "NX_NO_CLOUD=true" >> "$GITHUB_ENV"
fi
- name: Install dependencies
run: pnpm install
- name: Build workspace packages
run: pnpm exec nx run-many -t build --projects="@tsparticles/confetti-website,@tsparticles/website"
- name: Generate GitHub App token (confetti)
id: token-confetti
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.PAGES_APP_ID }}
private-key: ${{ secrets.PAGES_APP_PRIVATE_KEY }}
owner: tsparticles
repositories: |
confetti
- name: Generate GitHub App token (website)
id: token-website
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.PAGES_APP_ID }}
private-key: ${{ secrets.PAGES_APP_PRIVATE_KEY }}
owner: tsparticles
repositories: |
website
- name: Deploy to tsparticles/confetti main
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ steps.token-confetti.outputs.token }}
external_repository: tsparticles/confetti
publish_branch: main
publish_dir: websites/confetti/dist
cname: confetti.js.org
user_name: 'github-actions-bot'
user_email: 'support+actions@github.com'
commit_message: 'build: website updated'
force_orphan: true
- name: Deploy to tsparticles/website main
uses: peaceiris/actions-gh-pages@v4
with:
personal_token: ${{ steps.token-website.outputs.token }}
external_repository: tsparticles/website
publish_branch: main
publish_dir: websites/website/docs/.vitepress/dist
cname: particles.js.org
user_name: 'github-actions-bot'
user_email: 'support+actions@github.com'
commit_message: 'build: website updated'
force_orphan: true