This commit is contained in:
parent
29364bbff7
commit
0c484ca7a0
31
.github/workflows/deploy.yml
vendored
Normal file
31
.github/workflows/deploy.yml
vendored
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
name: hugo-deploy
|
||||||
|
run-name: build and deploy hugo page
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
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
|
||||||
|
|
||||||
|
- uses: webfactory/ssh-agent@v0.7.0
|
||||||
|
with:
|
||||||
|
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
|
- name: Add known host
|
||||||
|
run: |
|
||||||
|
sudo mkdir -p ~/.ssh
|
||||||
|
sudo chmod 700 ~/.ssh
|
||||||
|
sudo echo "${{ secrets.KNOWN_HOST_KEY }}" > ~/.ssh/known_hosts
|
||||||
|
- name: Deploy with rsync
|
||||||
|
run: rsync -atv --delete --progress --checksum --whole-file -e ssh dist/ ${{ secrets.REMOTE_USER }}@${{ secrets.REMOTE_HOST }}:${{ secrets.DEPLOY_LOCATION }}
|
Loading…
Reference in a new issue