Skip to content

Commit 39a6746

Browse files
committed
add workflow
1 parent a6432a3 commit 39a6746

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

.github/workflows/upload.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Build and upload website
2+
on: [push]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- name: Checkout repository
8+
uses: actions/checkout@v3
9+
- name: Setup dependencies
10+
run: |
11+
sudo apt-get update
12+
sudo apt-get install -y hugo
13+
14+
- name: Build website
15+
run: |
16+
hugo --minify
17+
18+
- name: Create SSH key
19+
run: |
20+
mkdir -p ~/.ssh/
21+
echo "$SSH_PRIVATE_KEY" > ../private.key
22+
sudo chmod 600 ../private.key
23+
echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
24+
shell: bash
25+
env:
26+
SSH_PRIVATE_KEY: ${{secrets.SSH_PRIVATE_KEY}}
27+
SSH_KNOWN_HOSTS: ${{secrets.SSH_KNOWN_HOSTS}}
28+
SSH_KEY_PATH: ${{ github.workspace }}/../private.key
29+
30+
- name: Upload website
31+
run: |
32+
rsync -ave "ssh -p 8058" public/* zenith@bwsecondary.ddns.net:/etc/nginx/html/html/html_capy

0 commit comments

Comments
 (0)