-
Notifications
You must be signed in to change notification settings - Fork 11
59 lines (51 loc) · 1.87 KB
/
Copy pathdeploy.yml
File metadata and controls
59 lines (51 loc) · 1.87 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
name: Deploy to GitHub Pages
on:
push:
branches: [main]
workflow_dispatch:
permissions:
contents: write
# Prevent parallel deploys if multiple commits are pushed to main in quick
# succession. The last push wins; earlier runs are cancelled.
concurrency:
group: deploy-pages
cancel-in-progress: true
jobs:
build-and-deploy:
# Do not attempt to deploy documentation on forks
if: github.repository_owner == 'UC-OSPO-Network'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
# To set up a cross-repository deploy key:
# 1. Create a key pair:
# `ssh-keygen -t ed25519 -C "ucospo.net_deploy_bot@nomail"`
# 2. Add the public key to the UC-OSPO-Network/UC-OSPO-Network.github.io repo
# - Settings -> Deploy keys -> Add new
# - Make sure the key has write permissions
# 3. Add private key as a secret to UC-OSPO-Network/ucospo.net repo
# - Settings -> Secrets -> New Repository Secret
# - Make sure the name is the same as below: CI_DEPLOY_KEY
- name: Install SSH agent
if: github.ref == 'refs/heads/main'
uses: webfactory/ssh-agent@e83874834305fe9a4a2997156cb26c5de65a8555 # v0.10.0
with:
ssh-private-key: ${{ secrets.CI_DEPLOY_KEY }}
- name: Build website
if: github.ref == 'refs/heads/main'
run: make html
- name: Deploy website
if: github.ref == 'refs/heads/main'
uses: JamesIves/github-pages-deploy-action@releases/v4
with:
git-config-name: ucospo.net_deploy_bot
git-config-email: ucospo.net_deploy_bot@nomail
folder: _build/html
repository-name: UC-OSPO-Network/uc-OSPO-Network.github.io
branch: main
target-folder: latest
ssh-key: true