-
Notifications
You must be signed in to change notification settings - Fork 7
47 lines (41 loc) · 1.31 KB
/
ci.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
46
47
name: CI
on: [push, pull_request]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != 'scalalaz-podcast/scalalaz-gen'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6
- uses: actions/setup-java@v2
with:
distribution: temurin
java-version: 11
- name: Build and test
run: sbt ";test ;run"
- uses: actions/upload-artifact@v2
with:
name: site
path: target/site
deploy:
if: github.ref == 'refs/heads/master' && github.event_name != 'pull_request'
needs: [build]
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
with:
name: site
path: target/site
- uses: burnett01/[email protected]
env:
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
if: ${{ env.DEPLOY_HOST != '' && env.DEPLOY_USER != '' && env.DEPLOY_KEY != '' }}
with:
switches: -r
path: target/site/*
remote_path: /home/${{ secrets.DEPLOY_USER }}/site_target
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}