commit
16ec65755a
1 changed files with 13 additions and 17 deletions
30
.github/workflows/deploy.yml
vendored
30
.github/workflows/deploy.yml
vendored
|
@ -1,4 +1,4 @@
|
||||||
name: Build and Deploy Hugo Site
|
name: Deploy latest site
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -6,24 +6,20 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Setup Hugo
|
- name: Setup SSH
|
||||||
uses: peaceiris/actions-hugo@v3
|
run: |
|
||||||
with:
|
mkdir -p ~/.ssh
|
||||||
hugo-version: 'latest'
|
echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id
|
||||||
|
chmod 600 ~/.ssh/id
|
||||||
|
echo "${{ secrets.SERVER_FINGERPRINT }}" >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
- name: Build
|
- name: Run rotten-build command
|
||||||
run: hugo --minify
|
run: |
|
||||||
|
ssh -o StrictHostKeyChecking=yes ${{ secrets.SSH_USERNAME }}@${{ secrets.SERVER_ADDRESS }} "sudo rotten-build"
|
||||||
- name: Deploy to GitHub Pages
|
|
||||||
uses: peaceiris/actions-gh-pages@v3
|
|
||||||
with:
|
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
publish_dir: ./public
|
|
||||||
publish_branch: pages
|
|
||||||
|
|
Loading…
Reference in a new issue