1
0
Fork 0

added deploy job
Some checks are pending
hugo-deploy / deploy (push) Waiting to run

This commit is contained in:
Mia Rose Winter 2024-06-02 18:21:15 +02:00
parent 29364bbff7
commit 0c484ca7a0
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E

31
.github/workflows/deploy.yml vendored Normal file
View 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 }}