Skip to content

Commit c9ad788

Browse files
Fix cross-repo deployment (#287)
* Fix cross-repo deployment * Testing * Run linter
1 parent 4cdc9e8 commit c9ad788

2 files changed

Lines changed: 36 additions & 3 deletions

File tree

.github/workflows/circleci_redirect.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
name: CircleCI redirect
2+
13
on: [status]
24

35
permissions: read-all
46

57
jobs:
68
circleci_artifacts_redirector_job:
79
runs-on: ubuntu-latest
8-
if: "${{ github.event.context == 'ci/circleci: build_website' }}"
10+
# if: "${{ github.event.context == 'ci/circleci: build_website' }}"
911
permissions:
1012
statuses: write
1113
name: Run CircleCI artifacts redirector

.github/workflows/deploy.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,35 @@ concurrency:
1616

1717
jobs:
1818
build-and-deploy:
19+
# Do not attempt to deploy documentation on forks
20+
if: github.repository_owner == 'UC-OSPO-Network'
1921
runs-on: ubuntu-latest
2022
steps:
2123
- uses: actions/checkout@v4
2224

2325
- uses: actions/setup-node@v4
2426
with:
25-
node-version: 20
27+
node-version: 24
2628
cache: npm
2729

28-
- run: make check
30+
# To set up a cross-repository deploy key:
31+
# 1. Create a key pair:
32+
# `ssh-keygen -t ed25519 -C "ucospo.net_deploy_bot@nomail"`
33+
# 2. Add the public key to the UC-OSPO-Network/UC-OSPO-Network.github.io repo
34+
# - Settings -> Deploy keys -> Add new
35+
# - Make sure the key has write permissions
36+
# 3. Add private key as a secret to UC-OSPO-Network/ucospo.net repo
37+
# - Settings -> Secrets -> New Repository Secret
38+
# - Make sure the name is the same as below: CI_DEPLOY_KEY
39+
- name: Install SSH agent
40+
if: github.ref == 'refs/heads/main'
41+
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
42+
with:
43+
ssh-private-key: ${{ secrets.CI_DEPLOY_KEY }}
44+
45+
- name: Build website
46+
if: github.ref == 'refs/heads/main'
47+
run: make html
2948

3049
- uses: peaceiris/actions-gh-pages@v4
3150
with:
@@ -34,3 +53,15 @@ jobs:
3453
publish_branch: main
3554
publish_dir: _build/html
3655
cname: ucospo.net
56+
57+
- name: Deploy website
58+
if: github.ref == 'refs/heads/main'
59+
uses: JamesIves/github-pages-deploy-action@releases/v4
60+
with:
61+
git-config-name: ucospo.net_deploy_bot
62+
git-config-email: ucospo.net_deploy_bot@nomail
63+
folder: _build/html
64+
repository-name: UC-OSPO-Network/uc-OSPO-Network.github.io
65+
branch: main
66+
target-folder: latest
67+
ssh-key: true

0 commit comments

Comments
 (0)