Files
davideisinger.com/.github/workflows/deploy.yml
David Eisinger 71790b2376 rsync deploy
2023-01-11 11:29:32 -05:00

30 lines
751 B
YAML

name: Deploy
on: [push, workflow_dispatch]
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v2
- name: Setup hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: "0.109.0"
extended: true
- name: Install SSH deploy key
if: ${{ github.ref == 'refs/heads/main' }}
env:
DEPLOY_KEY: ${{ secrets.CI_DEPLOY_KEY }}
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
echo "$DEPLOY_KEY" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan 107.170.116.37 > ~/.ssh/known_hosts
- name: Deploy
if: ${{ github.ref == 'refs/heads/main' }}
run: bin/deploy