-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (30 loc) · 1015 Bytes
/
deploy-docs.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
name: Deploy to Oracle Cloud
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout the current branch
uses: actions/checkout@v3 # checkout the repo
with:
ref: gh-pages
- name: Initialize the ssh-agent # configure ssh private key
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.ORACLE_YUL_KEY }}
# SSH keyscan to avoid error
- name: Scan the host key
run: mkdir -p ~/.ssh/ && ssh-keyscan -H $DEPLOY_SERVER >> ~/.ssh/known_hosts
env:
DEPLOY_SERVER: ${{ secrets.ORACLE_YUL_IP }}
# Runs the rsync command to the remote site (caddy reverse proxy)
- name: Deploy the website
run: >-
rsync -avx --delete --exclude '.ssh' --exclude '.git' . $DEPLOY_USERNAME@$DEPLOY_SERVER:./caddy/www
env:
DEPLOY_SERVER: ${{ secrets.ORACLE_YUL_IP }}
DEPLOY_USERNAME: ubuntu