forked from CGAL/cgal-web
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (41 loc) · 1.37 KB
/
Deploy_web_site_with_ssh.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
name: Deploy_web_site_with_ssh
on:
push:
branches:
- master
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
bundler-cache: true
- name: Setup Jekyll
run: |
gem install jekyll bundler
- name: Update Configuration
run: |
yq -i '.JB.BASE_PATH = "${{ vars.CGAL_WEB_SITE_URL }}"' _config.yml
yq -i '.baseurl = "${{ vars.CGAL_WEB_SITE_URL }}"' _config.yml
yq -i '.JB.ASSET_PATH = "${{ vars.CGAL_WEB_SITE_URL }}/assets/themes/cgal/"' _config.yml
- run: cat _config.yml
- name: Remove demo/ (temporarily)
run: rm -rf demo/
- name: setup nodejs
run: npm install
- name: Build with jekyll
run: jekyll build --destination ./_site
- name: install ssh keys
run: |
install -m 600 -D /dev/null ~/.ssh/id_rsa
echo "${{ secrets.CGAL_WEB_SFTP_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
ssh-keyscan -H ${{ vars.CGAL_WEB_SFTP_HOST }} > ~/.ssh/known_hosts
- name: rsync
run: rsync -avz ./_site/ ${{ secrets.CGAL_WEB_SFTP_USERNAME }}@${{ vars.CGAL_WEB_SFTP_HOST }}:${{ vars.CGAL_WEB_SFTP_DESTDIR }}
- name: cleanup
run: rm -rf ~/.ssh