-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (43 loc) · 1.62 KB
/
deploy.yml
File metadata and controls
50 lines (43 loc) · 1.62 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
name: "deploy"
on:
# Trigger workflow on every pull request and every push to master
pull_request:
push:
branches:
- master
# Enable us to manually run the workflow
workflow_dispatch:
# Cancel outdated in-progress jobs if a newer one is queued
concurrency:
group: deploy-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
build:
name: Build & Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout Git Repository
uses: actions/checkout@v3
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.0"
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Build Jekyll Website
run: JEKYLL_ENV=production bundle exec jekyll build
- name: Create SSH key
if: ${{ success() && ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.ref == 'refs/heads/master' }}
run: |
mkdir -p ~/.ssh/
echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_ed25519
sudo chmod 600 ~/.ssh/id_ed25519
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
shell: bash
env:
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
- name: Deploy to flexflow.ai
# Only deploy on push to master
if: ${{ success() && ( github.event_name == 'push' || github.event_name == 'workflow_dispatch' ) && github.ref == 'refs/heads/master' }}
run: |
rsync --delete -rvzhPe ssh ./_site/ flexflow-ai@lissitzky.lockshaw.net:/opt/www/flexflow.ai/