1
0
Fork 0
winter-software.com/.github/workflows/deploy.yml

36 lines
970 B
YAML
Raw Permalink Normal View History

2024-06-02 16:21:15 +00:00
name: hugo-deploy
run-name: build and deploy hugo page
on:
push:
branches:
- main
defaults:
run:
shell: bash
jobs:
deploy:
runs-on: ubuntu-22.04
2024-06-02 16:21:15 +00:00
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
- run: npm ci
- run: npm run build
2024-06-02 16:40:46 +00:00
- uses: https://github.com/webfactory/ssh-agent@v0.9.0
2024-06-02 16:21:15 +00:00
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add known host
run: |
2024-06-02 16:43:44 +00:00
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "${{ secrets.KNOWN_HOST_KEY }}" > ~/.ssh/known_hosts
- name: Install rsync
run: |
apt-get update
apt-get -y install rsync
2024-06-02 16:21:15 +00:00
- name: Deploy with rsync
2024-06-02 17:03:23 +00:00
run: rsync -atv --delete --progress --checksum --whole-file -e ssh public/ ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:${{ secrets.DEPLOY_LOCATION }}