Skip to content

Commit 9f2bbf1

Browse files
committed
CICD: simplify rsync deployment
1 parent 5e912d2 commit 9f2bbf1

File tree

1 file changed

+12
-18
lines changed

1 file changed

+12
-18
lines changed

.github/workflows/ci-site.yaml

+12-18
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: Website
22

33
on:
44
workflow_dispatch:
5-
push:
6-
#paths:
7-
#- "website/**"
5+
push: # only runs on commits to main branch (typically after a merge)
6+
branches:
7+
- main
88

99
jobs:
1010
build:
@@ -13,28 +13,22 @@ jobs:
1313
steps:
1414
- name: 🛒 Checkout
1515
uses: actions/checkout@v2
16-
1716
- name: ✨ Setup Hugo
1817
env:
19-
HUGO_VERSION: 0.92.2
18+
HUGO_VERSION: 0.100.1
2019
run: |
2120
mkdir ~/hugo
2221
cd ~/hugo
2322
curl -L "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_${HUGO_VERSION}_Linux-64bit.tar.gz" --output hugo.tar.gz
2423
tar -xvzf hugo.tar.gz
2524
sudo mv hugo /usr/local/bin
26-
2725
- name: 🛠️ Build
2826
run: hugo --source website --destination output --cleanDestinationDir --baseURL https://swharden.com/csdv/ --debug --minify
29-
30-
- name: 🔑 Install SSH Key
31-
run: |
32-
install -m 600 -D /dev/null ~/.ssh/id_rsa
33-
echo "${{ secrets.REMOTE_SSH_KEY }}" > ~/.ssh/id_rsa
34-
echo "${{ secrets.KNOWN_HOSTS }}" > ~/.ssh/known_hosts
35-
36-
- name: 🚀 Deploy
37-
run: rsync --archive --delete --stats -e 'ssh -p 18765' 'website/output/' ${{ secrets.REMOTE_DEST }}
38-
39-
#- name: 🧹 Purge Website Cache
40-
#run: curl --user deploy:${{ secrets.CACHE_PASSWORD }} https://scottplot.net/admin/clear-cache.php
27+
- name: 🔐 Create Key File
28+
run: install -m 600 -D /dev/null ~/.ssh/id_rsa
29+
- name: 🔑 Populate Key
30+
run: echo "${{ secrets.PRIVATE_KEY }}" > ~/.ssh/id_rsa
31+
- name: 🚀 Upload
32+
run: rsync --archive --stats -e 'ssh -p 18765 -o StrictHostKeyChecking=no' 'website/output/' [email protected]:~/www/swharden.com/public_html/csdv/
33+
- name: 🧹 Clear Cache
34+
run: ssh [email protected] -p 18765 "site-tools-client domain update id=1 flush_cache=1"

0 commit comments

Comments
 (0)