-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (44 loc) · 1.29 KB
/
deploy.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
name: deploy
on:
push:
branches:
- master
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- run: bundle install
- run:
bundle exec htmlproofer
--ignore-status-codes 429
$GITHUB_WORKSPACE/index.html
- run: which rsync
deploy:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.SSH_PRIVATE_KEY }}"
mkdir -p ~/.ssh && touch ~/.ssh/known_hosts
ssh-keyscan ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts
- name: test ssh
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: >
ssh "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}" -- ls "${{ secrets.DEPLOY_PATH }}"
- env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: >
rsync -rq --links --delete --exclude=".*"
--exclude="Gemfile*" --exclude="deploy_key*"
. "${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}"