69 lines
1.5 KiB
YAML
69 lines
1.5 KiB
YAML
name: Deploy Hugo site to Pages
|
|
|
|
on:
|
|
push:
|
|
branches: ["master"]
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
pages: write
|
|
id-token: write
|
|
|
|
concurrency:
|
|
group: "pages"
|
|
cancel-in-progress: false
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Setup Hugo
|
|
uses: peaceiris/actions-hugo@v3
|
|
with:
|
|
hugo-version: 'latest'
|
|
# extended: true
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
submodules: recursive
|
|
- name: Setup Pages
|
|
id: pages
|
|
uses: actions/configure-pages@v4
|
|
- name: Build with Hugo
|
|
env:
|
|
HUGO_ENVIRONMENT: production
|
|
HUGO_ENV: production
|
|
run: |
|
|
hugo \
|
|
--minify \
|
|
--baseURL "${{ steps.pages.outputs.base_url }}/"
|
|
- name: Upload artifact
|
|
uses: actions/upload-pages-artifact@v3
|
|
with:
|
|
path: ./public
|
|
- name: FTP Deploy
|
|
uses: SamKirkland/FTP-Deploy-Action@v4.3.5
|
|
with:
|
|
server: ftp.netim.hosting
|
|
username: AS12798_FTP1
|
|
password: ${{ secrets.ftp_password }}
|
|
local-dir: ./public/
|
|
server-dir: jankremer.eu/public_www/
|
|
|
|
deploy:
|
|
environment:
|
|
name: github-pages
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- name: Deploy to GitHub Pages
|
|
id: deployment
|
|
uses: actions/deploy-pages@v4
|