diff --git a/.gitea/workflows/hugo_site_deployment.yml b/.gitea/workflows/hugo_site_deployment.yml index 8604f34..f627ac9 100644 --- a/.gitea/workflows/hugo_site_deployment.yml +++ b/.gitea/workflows/hugo_site_deployment.yml @@ -1,24 +1,41 @@ -name: Hugo site deploy & publish +name: Deploy Hugo Site + on: push: branches: - main jobs: - deploy-website: + deploy-hugo-site: + name: Build and Deploy to Server runs-on: ubuntu-latest steps: - - name: Do a git checkout including submodules + - name: Checkout Repository uses: actions/checkout@v4 + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v3 with: - submodules: true - - name: Generate and deploy website - uses: ronvanderheijden/hugo-rsync-deployment@master - env: - VPS_DEPLOY_KEY: ${{ secrets.HUGO_DEPLOY_PRIVATE_KEY }} - VPS_DEPLOY_USER: ${{ secrets.HUGO_DEPLOY_USERNAME }} - VPS_DEPLOY_HOST: 192.168.1.254 - VPS_DEPLOY_DEST: ${{ secrets.HUGO_SITE_LOCATION }} + hugo-version: "latest" + extended: true + + - name: Build Hugo Site + run: hugo --minify + + - name: Deploy to Server via SSH + uses: appleboy/scp-action@v0.1.7 with: - hugo-arguments: '--source=. --configDir=config/ -e production' - rsync-arguments: '--archive --compress --xattrs --dry-run' \ No newline at end of file + host: ${{ secrets.HUGO_SITE_HOST }} + username: ${{ secrets.SERVER_USER }} + key: ${{ secrets.SSH_PRIVATE_KEY }} + source: "public/" + target: "${{ secrets.HUGO_SITE_LOCATION }}/" + + - name: Restart Hugo Container (Optional) + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HUGO_SITE_HOST }} + username: ${{ secrets.HUGO_DEPLOY_USERNAME }} + key: ${{ secrets.HUGO_DEPLOY_PRIVATE_KEY }} + script: | + docker restart hugo diff --git a/.gitignore b/.gitignore index 0299c7e..f8c1755 100644 --- a/.gitignore +++ b/.gitignore @@ -1,15 +1,28 @@ -# ---> Hugo -# Generated files by hugo +# Hugo build output /public/ -/resources/_gen/ -/assets/jsconfig.json -hugo_stats.json +/resources/ -# Executable may be added to repository +# Hugo cache and lock files +.hugo_build.lock +.hugo_build.cache/ + +# OS-generated files +.DS_Store +Thumbs.db + +# Editor/IDE files +.vscode/ +.idea/ +*.iml + +# Temporary files +*.tmp +*.log +*.swp +*.swo +*.bak + +# Hugo executable binaries (if manually downloaded) hugo.exe hugo.darwin hugo.linux - -# Temporary lock file while building -/.hugo_build.lock -