Removed buildDrafts from hugo.toml, added deploy to drafts
GitHub Pages / deploy (push) Successful in 40s
GitHub Pages / deploy (push) Successful in 40s
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
name: GitHub Pages
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main # Set a branch to deploy
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
runs-on: ubuntu-latest
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive # Fetch Hugo themes (true OR recursive)
|
||||
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
|
||||
|
||||
- name: Setup Hugo
|
||||
uses: peaceiris/actions-hugo@v3
|
||||
with:
|
||||
hugo-version: 'latest'
|
||||
extended: true
|
||||
|
||||
- name: Build
|
||||
run: hugo -D --minify
|
||||
|
||||
- name: Install SSH Key
|
||||
uses: shimataro/ssh-key-action@v2
|
||||
with:
|
||||
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
known_hosts: 'placeholder'
|
||||
|
||||
- name: Adding Known Hosts
|
||||
run: ssh-keyscan -H ${{ secrets.SSH_IP }} >> ~/.ssh/known_hosts
|
||||
|
||||
- name: Deploy to remote server
|
||||
uses: easingthemes/ssh-deploy@v6
|
||||
with:
|
||||
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||
ARGS: "-rlgoDzvc -i --delete"
|
||||
SOURCE: "./public/"
|
||||
REMOTE_HOST: ${{ secrets.SSH_IP }}
|
||||
REMOTE_USER: ${{ secrets.SSH_USER }}
|
||||
TARGET: "/var/www/blog-drafts"
|
||||
SCRIPT_AFTER: |
|
||||
chown -R caddy:caddy /var/www/blog-drafts
|
||||
|
||||
# - name: Deploy to remote server
|
||||
# run: rsync -avz ./public/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_IP }}:/var/www/blog
|
||||
|
||||
# - name: Chmod files to Caddy user
|
||||
# run: ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_IP }} "chown -R caddy:caddy /var/www/blog"
|
||||
Reference in New Issue
Block a user