aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/.github/workflows/jekyll.yml
blob: 6a3c6469978017ea196ca39a9ee914cb1b03d735 (plain) (blame)
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
name: Jekyll

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  deploy:
    runs-on: ubuntu-latest
    env:
      JEKYLL_GITHUB_TOKEN: '${{ secrets.GH_TOKEN }}'
    name: Deploy
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          bundler-cache: true
      - name: Build
        run: make build
      - name: Check integrity
        run: |
          nohup make serve LIVE_RELOAD=0 &
          sleep 3 && make wget
      - name: Set up ssh-agent
        uses: webfactory/ssh-agent@v0.7.0
        with:
          ssh-private-key: '${{ secrets.REMOTE_SSH_KEY }}'
      - name: Deploy
        run: make deploy
        env:
          REMOTE_USER: '${{ secrets.REMOTE_USER }}'
          REMOTE_HOST: '${{ secrets.REMOTE_HOST }}'
          REMOTE_PORT: '${{ secrets.REMOTE_PORT }}'
          REMOTE_DIR: '${{ secrets.REMOTE_DIR }}'
        if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref == 'refs/heads/master'