-
Notifications
You must be signed in to change notification settings - Fork 8
45 lines (42 loc) · 1.47 KB
/
build.yml
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
name: Build website
on:
push:
branches:
- "**"
pull_request:
branches:
- main
workflow_dispatch:
jobs:
build:
name: Build website
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install -y ruby-bundler
name: Install prerequisites
- uses: actions/checkout@v4
- run: bundle install
name: Install bundle
- run: bundle exec jekyll build
name: Build website
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.WEBSITE_OPENSSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.WEBSITE_KNOWN_HOSTS }}
if: ${{ github.repository == 'FEniCS/web' && github.ref == 'refs/heads/main' }}
- name: rsync over ssh
run: rsync -r ./_site/* [email protected]:/var/www/vhosts/fenicsproject.org/newsite
if: ${{ github.repository == 'FEniCS/web' && github.ref == 'refs/heads/main' }}
- name: Make artifact zip
run: |
sudo apt-get install -y zip
zip -q -r _site.zip _site
if: ${{ github.repository == 'FEniCS/web' && github.ref != 'refs/heads/main' && github.event_name == 'pull_request' }}
- name: Upload build as artifact
uses: actions/upload-artifact@v4
with:
name: website
path: _site.zip
if-no-files-found: error
if: ${{ github.repository == 'FEniCS/web' && github.ref != 'refs/heads/main' && github.event_name == 'pull_request' }}