Skip to content

Commit 2cb60f4

Browse files
authored
Merge pull request #203 from Hubs-Foundation/sync-publish
also publishes updated versions using rsync
2 parents 15f1652 + db6c08d commit 2cb60f4

File tree

5 files changed

+5342
-4504
lines changed

5 files changed

+5342
-4504
lines changed

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: publish
2+
on:
3+
push:
4+
paths-ignore: ["README.md", "CONTRIBUTING.md", "LICENSE"]
5+
pull_request:
6+
paths-ignore: ["README.md", "CONTRIBUTING.md", "LICENSE"]
7+
branches:
8+
- main
9+
workflow_dispatch:
10+
11+
jobs:
12+
build_sync:
13+
runs-on: ubuntu-latest
14+
defaults:
15+
run:
16+
working-directory: ./website
17+
steps:
18+
- name: checkout repo
19+
uses: actions/checkout@v4
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: 22
24+
- name: include dependencies
25+
run: npm ci
26+
- name: build HTML
27+
run: npm run build
28+
- name: sync publish
29+
if: ${{ github.ref == 'refs/heads/master' && github.repository == 'Hubs-Foundation/hubs-docs' }}
30+
env:
31+
source: build/hubs-docs/
32+
dest: [email protected]:wordpress/hubs-docs
33+
run: |
34+
env
35+
mkdir -p ~/.ssh
36+
echo "${{ secrets.WEBCONTAINERS_KEY }}" > ~/.ssh/WEBCONTAINERS_KEY
37+
chmod 600 ~/.ssh/WEBCONTAINERS_KEY
38+
echo ${{ vars.KNOWN_HOSTS }} > ~/.ssh/known_hosts
39+
rsync -v ---rsh='ssh -i ~/.ssh/WEBCONTAINERS_KEY' --archive --delete-after $source $dest

0 commit comments

Comments
 (0)